Skip to content

Commit ad7fc10

Browse files
authored
add benchmark results for object detection (#106)
1 parent 9c116f1 commit ad7fc10

File tree

8 files changed

+68
-9
lines changed

8 files changed

+68
-9
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ Guidelines:
1515

1616
## Models & Benchmark Results
1717

18-
| Model | Task | Input Size | INTEL-CPU (ms) | RPI-CPU (ms) | JETSON-GPU (ms) | KV3-NPU (ms) | D1-CPU (ms) |
19-
| ---------------------------------------------------- | ----------------------------- | ---------- | -------------- | ------------ | --------------- | ------------ | ----------- |
18+
| Model | Task | Input Size | INTEL-CPU (ms) | RPI-CPU (ms) | JETSON-GPU (ms) | KV3-NPU (ms) | D1-CPU (ms) |
19+
| ------------------------------------------------------- | ----------------------------- | ---------- | -------------- | ------------ | --------------- | ------------ | ----------- |
2020
| [YuNet](./models/face_detection_yunet) | Face Detection | 160x120 | 1.45 | 6.22 | 12.18 | 4.04 | 86.69 |
2121
| [SFace](./models/face_recognition_sface) | Face Recognition | 112x112 | 8.65 | 99.20 | 24.88 | 46.25 | --- |
22-
| [LPD-YuNet](./models/license_plate_detection_yunet/) | License Plate Detection | 320x240 | --- | 168.03 | 56.12 | 29.53 | |
22+
| [LPD-YuNet](./models/license_plate_detection_yunet/) | License Plate Detection | 320x240 | --- | 168.03 | 56.12 | 29.53 | --- |
23+
| [YOLOX](./models/object_detection_yolox/) | Object Detection | 640x640 | 176.68 | 1496.70 | 388.95 | 420.98 | --- |
24+
| [NanoDet](./models/object_detection_nanodet/) | Object Detection | 416x416 | 157.91 | 220.36 | 64.94 | 116.64 | --- |
2325
| [DB-IC15](./models/text_detection_db) | Text Detection | 640x480 | 142.91 | 2835.91 | 208.41 | --- | --- |
2426
| [DB-TD500](./models/text_detection_db) | Text Detection | 640x480 | 142.91 | 2841.71 | 210.51 | --- | --- |
2527
| [CRNN-EN](./models/text_recognition_crnn) | Text Recognition | 100x32 | 50.21 | 234.32 | 196.15 | 125.30 | --- |
@@ -68,6 +70,12 @@ Some examples are listed below. You can find more in the directory of each model
6870

6971
![license plate detection](./models/license_plate_detection_yunet/examples/lpd_yunet_demo.gif)
7072

73+
### Object Detection with [NanoDet](./models/object_detection_nanodet/) & [YOLOX](./models/object_detection_yolox/)
74+
75+
![nanodet demo](./models/object_detection_nanodet/samples/1_res.jpg)
76+
77+
![yolox demo](./models/object_detection_yolox/samples/3_res.jpg)
78+
7179
### Object Tracking with [DaSiamRPN](./models/object_tracking_dasiamrpn/)
7280

7381
![webcam demo](./models/object_tracking_dasiamrpn/examples/dasiamrpn_demo.gif)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Benchmark:
2+
name: "Object Detection Benchmark"
3+
type: "Detection"
4+
data:
5+
path: "benchmark/data/object_detection"
6+
files: ["1.png", "2.png", "3.png"]
7+
sizes:
8+
- [416, 416]
9+
metric:
10+
warmup: 30
11+
repeat: 10
12+
reduction: "median"
13+
backend: "default"
14+
target: "cpu"
15+
16+
Model:
17+
name: "NanoDet"
18+
modelPath: "models/object_detection_nanodet/object_detection_nanodet_2022nov.onnx"
19+
prob_threshold: 0.35
20+
iou_threshold: 0.6
21+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Benchmark:
2+
name: "Object Detection Benchmark"
3+
type: "Detection"
4+
data:
5+
path: "benchmark/data/object_detection"
6+
files: ["1.png", "2.png", "3.png"]
7+
sizes:
8+
- [640, 640]
9+
metric:
10+
warmup: 30
11+
repeat: 10
12+
reduction: "median"
13+
backend: "default"
14+
target: "cpu"
15+
16+
Model:
17+
name: "YoloX"
18+
modelPath: "models/object_detection_yolox/object_detection_yolox_2022nov.onnx"
19+
confThreshold: 0.35
20+
nmsThreshold: 0.5
21+
objThreshold: 0.5
22+

benchmark/download_data.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,10 @@ def get_confirm_token(response): # in case of large files
205205
url='https://drive.google.com/u/0/uc?id=1cf9MEyUqMMy8lLeDGd1any6tM_SsSmny&export=download',
206206
sha='997acb143ddc4531e6e41365fb7ad4722064564c',
207207
filename='license_plate_detection.zip'),
208+
object_detection=Downloader(name='object_detection',
209+
url='https://drive.google.com/u/0/uc?id=1LUUrQIWYYtiGoNAL_twZvdw5NkC39Swe&export=download',
210+
sha='4161a5cd3b0be1f51484abacf19dc9a2231e9894',
211+
filename='object_detection.zip'),
208212
)
209213

210214
if __name__ == '__main__':

models/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
from .palm_detection_mediapipe.mp_palmdet import MPPalmDet
1313
from .handpose_estimation_mediapipe.mp_handpose import MPHandPose
1414
from .license_plate_detection_yunet.lpd_yunet import LPD_YuNet
15+
from .object_detection_nanodet.nanodet import NanoDet
16+
from .object_detection_yolox.yolox import YoloX
1517

1618
class Registery:
1719
def __init__(self, name):
@@ -39,3 +41,6 @@ def register(self, item):
3941
MODELS.register(MPPalmDet)
4042
MODELS.register(MPHandPose)
4143
MODELS.register(LPD_YuNet)
44+
MODELS.register(NanoDet)
45+
MODELS.register(YoloX)
46+

models/object_detection_nanodet/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ Here are some of the sample results that were observed using the model,
2424

2525
![test1_res.jpg](./samples/1_res.jpg)
2626
![test2_res.jpg](./samples/2_res.jpg)
27-
27+
28+
Check [benchmark/download_data.py](../../benchmark/download_data.py) for the original images.
29+
2830
Video inference result,
2931
![WebCamR.gif](./samples/WebCamR.gif)
3032

models/object_detection_nanodet/nanodet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __init__(self, modelPath, prob_threshold=0.35, iou_threshold=0.6, backend_id
3737
def name(self):
3838
return self.__class__.__name__
3939

40-
def setBackend(self, backenId):
40+
def setBackend(self, backendId):
4141
self.backend_id = backendId
4242
self.net.setPreferableBackend(self.backend_id)
4343

models/object_detection_yolox/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ Here are some of the sample results that were observed using the model (**yolox_
3333
![2_res.jpg](./samples/2_res.jpg)
3434
![3_res.jpg](./samples/3_res.jpg)
3535

36-
<!--
37-
Video inference result,
38-
![WebCamR.gif](./examples/results/WebCamR.gif)
39-
-->
36+
Check [benchmark/download_data.py](../../benchmark/download_data.py) for the original images.
4037

4138
## Model metrics:
4239

0 commit comments

Comments
 (0)