Upload folder using huggingface_hub
Browse files
README.md
CHANGED
@@ -29,7 +29,7 @@ The recently-developed DETR approach applies the transformer encoder and decoder
|
|
29 |
|
30 |
## Intended uses & limitations
|
31 |
|
32 |
-
You can use the raw model for object detection. See the [model hub](https://huggingface.co/models?search=
|
33 |
|
34 |
### How to use
|
35 |
|
@@ -44,8 +44,8 @@ import requests
|
|
44 |
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
45 |
image = Image.open(requests.get(url, stream=True).raw)
|
46 |
|
47 |
-
processor = AutoImageProcessor.from_pretrained("
|
48 |
-
model = ConditionalDetrForObjectDetection.from_pretrained("
|
49 |
|
50 |
inputs = processor(images=image, return_tensors="pt")
|
51 |
outputs = model(**inputs)
|
@@ -64,13 +64,12 @@ for score, label, box in zip(results["scores"], results["labels"], results["boxe
|
|
64 |
```
|
65 |
This should output:
|
66 |
```
|
67 |
-
Detected
|
68 |
-
Detected
|
69 |
-
Detected cat with confidence 0.
|
|
|
70 |
```
|
71 |
|
72 |
-
Currently, both the feature extractor and model support PyTorch.
|
73 |
-
|
74 |
## Training data
|
75 |
|
76 |
The Conditional DETR model was trained on [COCO 2017 object detection](https://cocodataset.org/#download), a dataset consisting of 118k/5k annotated images for training/validation respectively.
|
|
|
29 |
|
30 |
## Intended uses & limitations
|
31 |
|
32 |
+
You can use the raw model for object detection. See the [model hub](https://huggingface.co/models?search=conditional-detr) to look for all available Conditional DETR models.
|
33 |
|
34 |
### How to use
|
35 |
|
|
|
44 |
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
45 |
image = Image.open(requests.get(url, stream=True).raw)
|
46 |
|
47 |
+
processor = AutoImageProcessor.from_pretrained("Omnifact/conditional-detr-resnet-101-dc5")
|
48 |
+
model = ConditionalDetrForObjectDetection.from_pretrained("Omnifact/conditional-detr-resnet-101-dc5")
|
49 |
|
50 |
inputs = processor(images=image, return_tensors="pt")
|
51 |
outputs = model(**inputs)
|
|
|
64 |
```
|
65 |
This should output:
|
66 |
```
|
67 |
+
Detected cat with confidence 0.865 at location [13.95, 64.98, 327.14, 478.82]
|
68 |
+
Detected remote with confidence 0.849 at location [39.37, 83.18, 187.67, 125.02]
|
69 |
+
Detected cat with confidence 0.743 at location [327.22, 35.17, 637.54, 377.04]
|
70 |
+
Detected remote with confidence 0.737 at location [329.36, 89.47, 376.42, 197.53]
|
71 |
```
|
72 |
|
|
|
|
|
73 |
## Training data
|
74 |
|
75 |
The Conditional DETR model was trained on [COCO 2017 object detection](https://cocodataset.org/#download), a dataset consisting of 118k/5k annotated images for training/validation respectively.
|