Team Ai
Modelpublic

baselefre/objectdetectionaugmentedclean

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
0likes25downloads
README.md52 linesDownload Raw Back to root
1---2tags:3- object-detection4- fashion5- conditional-detr6license: apache-2.07datasets:8- baselefre/new_embeddings_fixed_cats9---10 11# Fashion Object Detection Model12 13Fine-tuned Conditional DETR model for detecting 8 fashion categories:14- bag15- bottom  16- dress17- hat18- outer19- shoes20- top21- accessory22 23## Model Details24- Base model: microsoft/conditional-detr-resnet-5025- Training dataset: baselefre/new_embeddings_fixed_cats26- Checkpoint: 18000 steps27 28## Usage29 30```python31from transformers import AutoImageProcessor, AutoModelForObjectDetection32from PIL import Image33import torch34 35# Load model36processor = AutoImageProcessor.from_pretrained("baselefre/objectdetectionaugmentedclean")37model = AutoModelForObjectDetection.from_pretrained("baselefre/objectdetectionaugmentedclean")38 39# Load image40image = Image.open("your_image.jpg")41 42# Inference43inputs = processor(images=image, return_tensors="pt")44outputs = model(**inputs)45target_sizes = torch.tensor([image.size[::-1]])46results = processor.post_process_object_detection(outputs, threshold=0.5, target_sizes=target_sizes)[0]47 48# Print detections49for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):50    print(f"{model.config.id2label[label.item()]}: {score:.2f} at {box.tolist()}")51```52