Team Ai
Modelpublic

baselefre/objectdetectionaugmentedclean

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
0likes24downloads
Model Card

Fashion Object Detection Model

Fine-tuned Conditional DETR model for detecting 8 fashion categories:

  • —bag
  • —bottom
  • —dress
  • —hat
  • —outer
  • —shoes
  • —top
  • —accessory

Model Details

  • —Base model: microsoft/conditional-detr-resnet-50
  • —Training dataset: baselefre/newembeddingsfixed_cats
  • —Checkpoint: 18000 steps

Usage

python
from transformers import AutoImageProcessor, AutoModelForObjectDetection
from PIL import Image
import torch

# Load model
processor = AutoImageProcessor.from_pretrained("baselefre/objectdetectionaugmentedclean")
model = AutoModelForObjectDetection.from_pretrained("baselefre/objectdetectionaugmentedclean")

# Load image
image = Image.open("your_image.jpg")

# Inference
inputs = processor(images=image, return_tensors="pt")
outputs = model(**inputs)
target_sizes = torch.tensor([image.size[::-1]])
results = processor.post_process_object_detection(outputs, threshold=0.5, target_sizes=target_sizes)[0]

# Print detections
for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
    print(f"{model.config.id2label[label.item()]}: {score:.2f} at {box.tolist()}")