Instructions to use zeromodels/pvt-small-224 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ZeroModels
How to use zeromodels/pvt-small-224 with ZeroModels:
# pip install -U zeromodels # ZeroModels is pure Keras 3, so pick a backend: "jax", "torch" or "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" from zeromodels import AutoZModel # AutoZModel reads the repo's model_type and loads the matching class. # For a task head use the matching loader, e.g. AutoZMImageClassify / AutoZMDetect / # AutoZMSemanticSegment / AutoZMTextGenerate (see zeromodels.auto). model = AutoZModel.from_weights("zeromodels/pvt-small-224") - Keras
How to use zeromodels/pvt-small-224 with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://zeromodels/pvt-small-224") - Notebooks
- Google Colab
- Kaggle
| { | |
| "library_name": "zeromodels", | |
| "zeromodels_version": "1.2.6", | |
| "model_module": "zeromodels.models.pvt", | |
| "model_class": "PvtImageClassify", | |
| "variant": "pvt-small-224", | |
| "weights": "model.weights.h5", | |
| "schema_version": 2, | |
| "model_type": "pvt", | |
| "vision_config": { | |
| "hidden_sizes": [ | |
| 64, | |
| 128, | |
| 320, | |
| 512 | |
| ], | |
| "depths": [ | |
| 3, | |
| 4, | |
| 6, | |
| 3 | |
| ], | |
| "num_attention_heads": [ | |
| 1, | |
| 2, | |
| 5, | |
| 8 | |
| ], | |
| "sr_ratios": [ | |
| 8, | |
| 4, | |
| 2, | |
| 1 | |
| ], | |
| "mlp_ratios": [ | |
| 8, | |
| 8, | |
| 4, | |
| 4 | |
| ], | |
| "image_size": 224, | |
| "num_classes": 1000 | |
| } | |
| } |