Downloads · 30 days
153
9% of all-time downloads
ustc-community/hgnet-v2
hgnet-v2 is a feature extraction model from ustc-community. Use it when you need embeddings to search or compare text. It is set up for transformers.
This is the HF transformers implementation for HGNet-V2
Downloads · 30 days
153
9% of all-time downloads
All-time downloads
1.7K
Public
Parameters
33.4M
134 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors134 MB · 100%
From the Hugging Face model README
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])