File size: 2,042 Bytes
99c2e37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
tags:
- object-detection
- rf-detr
- package-segmentation
- computer-vision
library_name: rfdetr
license: apache-2.0
---

# RF-DETR Package Detection Model

This model is a fine-tuned **RF-DETR Medium** model for package/box detection, trained on a custom dataset.

## Model Description

- **Model Type:** RF-DETR (Real-time DETR for object detection)
- **Base Model:** RF-DETR Medium
- **Task:** Object Detection (Package/Box Segmentation)
- **Training Data:** Custom dataset
- **Classes:** 2 class(es)

## Training Details

- **Epochs:** N/A
- **Batch Size:** 16
- **Learning Rate:** 5e-05
- **Input Resolution:** 576x576

## Performance

Training metrics available in the model repository.

## Usage

### Installation

```bash
pip install rfdetr torch torchvision
```

### Loading the Model

```python
import torch
from rfdetr import RFDETRMedium
from PIL import Image

# Load model
model = RFDETRMedium()
checkpoint = torch.load("checkpoint_best_total.pth", map_location='cpu')
model.model.load_state_dict(checkpoint['model'])
model.model.eval()

# Run inference
image = Image.open("path/to/image.jpg")
results = model.predict(image)
```

### API Usage (with Inference Endpoints)

Once deployed as an Inference Endpoint:

```python
import requests
from PIL import Image
import io

API_URL = "https://api-inference.huggingface.co/models/YOUR_USERNAME/rf-detr-box-segmentation"
headers = {"Authorization": "Bearer YOUR_HF_TOKEN"}

# Send image
with open("image.jpg", "rb") as f:
    data = f.read()
response = requests.post(API_URL, headers=headers, data=data)
results = response.json()
```

## Model Details

- **Developed by:** Your Name
- **Model date:** 1762288019.2803671
- **Framework:** PyTorch
- **License:** Apache 2.0

## Citation

```bibtex
@software{rfdetr2024,
  title = {RF-DETR: Real-time DETR},
  author = {Roboflow},
  year = {2024},
  url = {https://github.com/roboflow/rf-detr}
}
```

## Limitations

This model is trained on a specific package detection dataset and may not generalize to all object detection tasks.