This is the HF transformers implementation for HGNet-V2
Model: HGNet-V2 - B4
A HGNet-V2 (High Performance GPU Net) image classification model.
Usage:
import torch
import requests
from PIL import Image
from transformers import HGNetV2ForImageClassification, AutoImageProcessor
url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
image = Image.open(requests.get(url, stream=True).raw)
image_processor = AutoImageProcessor.from_pretrained("ustc-community/hgnet-v2")
model = HGNetV2ForImageClassification.from_pretrained("ustc-community/hgnet-v2")
inputs = image_processor(images=image, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
outputs.logits.shape
torch.Size([1, 2])
- Downloads last month
- 8
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
๐
Ask for provider support