File size: 1,268 Bytes
deaeb97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
tags:
- object-detection
- fashion
- conditional-detr
license: apache-2.0
datasets:
- baselefre/new_embeddings_fixed_cats
---

# 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/new_embeddings_fixed_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()}")
```