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