Skip to content

Commit f9078f0

Browse files
committed
✨Add detailed documentation for the detection model
1 parent ad2bff3 commit f9078f0

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed
Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,43 @@
1-
# Detection Model
1+
# Detection Model
2+
3+
## Description
4+
5+
Detection model aims to detect objects in an image. The model outputs a list of detected objects, each containing a bounding box, score and class label.
6+
7+
## OpenVINO Model Specifications
8+
9+
### Inputs
10+
11+
A single input image of shape (H, W, 3) where H and W are the height and width of the image, respectively.
12+
13+
14+
### Outputs
15+
16+
Detection model outputs a list of detection objects (i.e `list[Detection]`) wrapped in `DetectionResult`, each object containing the following attributes:
17+
18+
- `score` (float) - Confidence score of the object.
19+
- `id` (int) - Class label of the object.
20+
- `str_label` (str) - String label of the object.
21+
- `xmin` (int) - X-coordinate of the top-left corner of the bounding box.
22+
- `ymin` (int) - Y-coordinate of the top-left corner of the bounding box.
23+
- `xmax` (int) - X-coordinate of the bottom-right corner of the bounding box.
24+
- `ymax` (int) - Y-coordinate of the bottom-right corner of the bounding box.
25+
26+
## Example
27+
28+
```python
29+
import cv2
30+
from model_api.models import SSD
31+
32+
# Load the model
33+
model = SSD.create_model("model.xml")
34+
35+
# Forward pass
36+
predictions = model(image)
37+
38+
# Iterate over the segmented objects
39+
for pred_obj in predictions.objects:
40+
pred_score = pred_obj.score
41+
label_id = pred_obj.id
42+
bbox = [pred_obj.xmin, pred_obj.ymin, pred_obj.xmax, pred_obj.ymax]
43+
```

0 commit comments

Comments
 (0)