From 5c012ed4cccd0efd6cad88a5b7346d1a29176954 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Wed, 17 Mar 2021 11:32:26 -0400 Subject: [PATCH] add experimental nanodet object detection --- Configuration.md | 14 ++++++++++++-- Credits.md | 1 + Models.md | 2 ++ Outputs.md | 12 ++++++++++++ Usage.md | 1 + 5 files changed, 28 insertions(+), 2 deletions(-) diff --git a/Configuration.md b/Configuration.md index a0c8f41..17c1db3 100644 --- a/Configuration.md +++ b/Configuration.md @@ -154,8 +154,8 @@ config = { }, embedding: { - enabled: false, // to improve accuracy of face embedding extraction it is recommended - // to enable detector.rotation and mesh.enabled + enabled: false, // to improve accuracy of face embedding extraction it is + // highly recommended to enable detector.rotation and mesh.enabled modelPath: '../models/mobileface.json', }, }, @@ -199,6 +199,16 @@ config = { modelPath: '../models/handskeleton.json', }, }, + + object: { + enabled: false, + modelPath: '../models/nanodet.json', + minConfidence: 0.15, // threshold for discarding a prediction + iouThreshold: 0.25, // threshold for deciding whether boxes overlap too much + // in non-maximum suppression + maxResults: 10, // maximum number of objects detected in the input + skipFrames: 13, // how many frames to go without re-running the detector + }, }; ``` diff --git a/Credits.md b/Credits.md index d2c1077..651283b 100644 --- a/Credits.md +++ b/Credits.md @@ -9,6 +9,7 @@ - Age & Gender Prediction: [**SSR-Net**](https://github.com/shamangary/SSR-Net) - Emotion Prediction: [**Oarriaga**](https://github.com/oarriaga/face_classification) - Face Embedding: [**BecauseofAI MobileFace**](https://github.com/becauseofAI/MobileFace) +- ObjectDetection: [**NanoDet**](https://github.com/RangiLyu/nanodet) - Image Filters: [**WebGLImageFilter**](https://github.com/phoboslab/WebGLImageFilter) - Pinto Model Zoo: [**Pinto**](https://github.com/PINTO0309/PINTO_model_zoo) diff --git a/Models.md b/Models.md index c7aa3b9..3b32001 100644 --- a/Models.md +++ b/Models.md @@ -12,6 +12,7 @@ Default models in Human library are: - **Age Detection**: SSR-Net Age IMDB - **Body Analysis**: PoseNet - **Face Embedding**: BecauseofAI MobileFace Embedding +- **Object Detection**: NanoDet ## Notes @@ -50,6 +51,7 @@ Default models in Human library are: | Sirius-AI MobileFaceNet | 125K | mobilefacenet.json | 5.0M | mobilefacenet.bin | 139 | | BecauseofAI MobileFace | 33K | mobileface.json | 2.1M | mobileface.bin | 75 | | FaceBoxes | 212K | faceboxes.json | 2.0M | faceboxes.bin | N/A | +| NanoDet | 255K | nanodet.json | 1.9M | nanodet.bin | 524 |
diff --git a/Outputs.md b/Outputs.md index 5590563..593a830 100644 --- a/Outputs.md +++ b/Outputs.md @@ -57,6 +57,18 @@ result = { annotations, // ]> 5 annotated landmakrs } ], + object: // + [ + { + score, // + class, // class id based on coco labels + label, // class label based on coco labels + center, // [, ] x,y coordinates of the object center + box, // [, , , ] x1, y1, x2, y2 coordinates of the box around the detected object + centerRaw, // same as center but normalized to range 0..1 + boxRaw, // same as box, but normalized to range 0..1 + } + ], gesture: // [ { diff --git a/Usage.md b/Usage.md index 5e02eb2..8901618 100644 --- a/Usage.md +++ b/Usage.md @@ -70,6 +70,7 @@ Additional helper functions inside `human.draw`: human.draw.face(canvas, results.face) // draw face detection results to canvas human.draw.body(canvas, results.body) // draw body detection results to canvas human.draw.hand(canvas, result.hand) // draw hand detection results to canvas + human.draw.object(canvas, result.object) // draw object detection results to canvas human.draw.gesture(canvas, result.gesture) // draw detected gesture results to canvas ```