Deep Learning Community Question

Looking for advice on how to use pre-trained AI models with Hugging Face for image recognition?

Posted on 2025-02-12 • In Deep Learning • By Joshua Taylor

Our team is exploring computer vision for a new retail project. Can someone explain how to use pre-trained AI models with Hugging Face for real-time image recognition? We need something that can identify products on a shelf with high precision. Is the ViT (Vision Transformer) the current gold standard, or should we stick to more traditional ResNet architectures available on the hub?

3 Answers 8,530 Views

All answers to this question 3 Answers

Deborah Lewis Answered on 2025-04-15
Answered

For retail applications where you need to distinguish between very similar products, Vision Transformers (ViT) are generally superior due to their global attention mechanism. You can load a pre-trained ViT model using the ViTImageProcessor and ViTForImageClassification. However, "real-time" is a relative term. If you are running this on edge devices like cameras, you might find ViT a bit heavy. In those cases, I’d suggest looking at MobileViT or a fine-tuned ResNet, which are significantly faster for inference on hardware with limited computational power.

Matthew Walker Answered on 2025-05-20
Answered

What specific hardware are you targeting for the "real-time" aspect? Are we talking about a powerful GPU-backed server or an ARM-based mobile processor? This really changes the recommendation for the model architecture.

Joshua Taylor Commented on 2025-05-22
Commented

Matthew, we are targeting NVIDIA Jetson modules at the edge. So, while we have some GPU power, we still need to be very mindful of the power consumption and thermal limits. That's why I was hesitant about the full-sized ViT models.

Brian Hall Answered on 2025-06-10
Answered

Hugging Face also has amazing support for YOLO models now via the ultralytics integration. It might be better for object detection than simple classification.

Deborah Lewis Commented on 2025-06-18
Commented

Brian is spot on. For shelf monitoring, detecting multiple items (YOLO) is much more useful than just classifying one image. The image-segmentation pipeline is also worth a look for precise masking.

Write a Comment

Your email address will not be published. Required fields are marked (*)

Join the LearnersEra Community

Ask questions, share knowledge and learn from professionals across technology, project management and certification topics.

Change Country and Nearest City

Select your country and nearest city to see courses available in your region.