🚀 MobileNet V1
A pre - trained MobileNet V1 model on ImageNet - 1k at a resolution of 224x224. It's a powerful tool for image classification tasks.
🚀 Quick Start
The MobileNet V1 model is pre - trained on the ImageNet - 1k dataset at a resolution of 224x224. It was first introduced in MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications by Howard et al, and initially released in this repository.
Disclaimer: The team that released MobileNet V1 did not write a model card for this model. This model card has been written by the Hugging Face team.
✨ Features
- Lightweight and Efficient: MobileNets are small, low - latency, and low - power models. They are parameterized to meet the resource constraints of various use cases.
- Versatile Applications: Similar to other large - scale models like Inception, MobileNets can be used for classification, detection, embeddings, and segmentation.
- Good Trade - off: MobileNets balance latency, size, and accuracy, comparing favorably with popular models from the literature.
📚 Documentation
Model description
From the original README:
MobileNets are small, low - latency, low - power models parameterized to meet the resource constraints of a variety of use cases. They can be built upon for classification, detection, embeddings and segmentation similar to how other popular large scale models, such as Inception, are used. MobileNets can be run efficiently on mobile devices [...] MobileNets trade off between latency, size and accuracy while comparing favorably with popular models from the literature.
Intended uses & limitations
You can use the raw model for image classification. Check out the model hub to find fine - tuned versions for tasks that interest you.
💻 Usage Examples
Basic Usage
Here is how to use this model to classify an image of the COCO 2017 dataset into one of the 1,000 ImageNet classes:
from transformers import MobileNetV1FeatureExtractor, MobileNetV1ForImageClassification
from PIL import Image
import requests
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
feature_extractor = MobileNetV1FeatureExtractor.from_pretrained("Matthijs/mobilenet_v1_1.0_224")
model = MobileNetV1ForImageClassification.from_pretrained("Matthijs/mobilenet_v1_1.0_224")
inputs = feature_extractor(images=image, return_tensors="pt")
outputs = model(**inputs)
logits = outputs.logits
predicted_class_idx = logits.argmax(-1).item()
print("Predicted class:", model.config.id2label[predicted_class_idx])
⚠️ Important Note
This model actually predicts 1001 classes, the 1000 classes from ImageNet plus an extra “background” class (index 0).
💡 Usage Tip
Currently, both the feature extractor and model support PyTorch.
📄 License
License: other
Property |
Details |
Tags |
vision, image - classification |
Datasets |
imagenet - 1k |
Widget Examples |
- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/tiger.jpg, example_title: Tiger
- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/teapot.jpg, example_title: Teapot
- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/palace.jpg, example_title: Palace
|