Fix usage example: import weights enum from lucid.models.weights
Browse files
README.md
CHANGED
|
@@ -35,17 +35,17 @@ converted to Lucid-native safetensors.
|
|
| 35 |
|
| 36 |
```python
|
| 37 |
import lucid.models as models
|
| 38 |
-
from lucid.models.
|
| 39 |
|
| 40 |
# default tag
|
| 41 |
model = models.convnext_base_cls(pretrained=True)
|
| 42 |
|
| 43 |
# explicit tag (enum or string)
|
| 44 |
-
model = models.convnext_base_cls(weights=
|
| 45 |
model = models.convnext_base_cls(pretrained="IMAGENET1K_V1")
|
| 46 |
|
| 47 |
# preprocessing travels with the weights
|
| 48 |
-
weights =
|
| 49 |
preprocess = weights.transforms()
|
| 50 |
logits = model(preprocess(image)[None]).logits
|
| 51 |
```
|
|
|
|
| 35 |
|
| 36 |
```python
|
| 37 |
import lucid.models as models
|
| 38 |
+
from lucid.models.weights import ConvNeXtBaseWeights
|
| 39 |
|
| 40 |
# default tag
|
| 41 |
model = models.convnext_base_cls(pretrained=True)
|
| 42 |
|
| 43 |
# explicit tag (enum or string)
|
| 44 |
+
model = models.convnext_base_cls(weights=ConvNeXtBaseWeights.IMAGENET1K_V1)
|
| 45 |
model = models.convnext_base_cls(pretrained="IMAGENET1K_V1")
|
| 46 |
|
| 47 |
# preprocessing travels with the weights
|
| 48 |
+
weights = ConvNeXtBaseWeights.IMAGENET1K_V1
|
| 49 |
preprocess = weights.transforms()
|
| 50 |
logits = model(preprocess(image)[None]).logits
|
| 51 |
```
|