WU Jia
commited on
Commit
·
a14bbf1
1
Parent(s):
4c44ba2
Change the default value of topK (#271)
Browse files* Change the default value of topK
* Change several more default values
models/person_detection_mediapipe/demo.cpp
CHANGED
@@ -31,7 +31,7 @@ private:
|
|
31 |
Mat anchors;
|
32 |
|
33 |
public:
|
34 |
-
MPPersonDet(string modPath, float nmsThresh = 0.
|
35 |
modelPath(modPath), nmsThreshold(nmsThresh),
|
36 |
scoreThreshold(scoreThresh), topK(tok),
|
37 |
backendId(bId), targetId(tId)
|
|
|
31 |
Mat anchors;
|
32 |
|
33 |
public:
|
34 |
+
MPPersonDet(string modPath, float nmsThresh = 0.3, float scoreThresh = 0.5, int tok = 5000, dnn::Backend bId = DNN_BACKEND_DEFAULT, dnn::Target tId = DNN_TARGET_CPU) :
|
35 |
modelPath(modPath), nmsThreshold(nmsThresh),
|
36 |
scoreThreshold(scoreThresh), topK(tok),
|
37 |
backendId(bId), targetId(tId)
|
models/person_detection_mediapipe/demo.py
CHANGED
@@ -36,7 +36,7 @@ parser.add_argument('--score_threshold', type=float, default=0.5,
|
|
36 |
help='Usage: Set the minimum needed confidence for the model to identify a person, defaults to 0.5. Smaller values may result in faster detection, but will limit accuracy. Filter out persons of confidence < conf_threshold.')
|
37 |
parser.add_argument('--nms_threshold', type=float, default=0.3,
|
38 |
help='Usage: Suppress bounding boxes of iou >= nms_threshold. Default = 0.3.')
|
39 |
-
parser.add_argument('--top_k', type=int, default=
|
40 |
help='Usage: Keep top_k bounding boxes before NMS.')
|
41 |
parser.add_argument('--save', '-s', action='store_true',
|
42 |
help='Usage: Specify to save file with results (i.e. bounding box, confidence level). Invalid in case of camera input.')
|
|
|
36 |
help='Usage: Set the minimum needed confidence for the model to identify a person, defaults to 0.5. Smaller values may result in faster detection, but will limit accuracy. Filter out persons of confidence < conf_threshold.')
|
37 |
parser.add_argument('--nms_threshold', type=float, default=0.3,
|
38 |
help='Usage: Suppress bounding boxes of iou >= nms_threshold. Default = 0.3.')
|
39 |
+
parser.add_argument('--top_k', type=int, default=5000,
|
40 |
help='Usage: Keep top_k bounding boxes before NMS.')
|
41 |
parser.add_argument('--save', '-s', action='store_true',
|
42 |
help='Usage: Specify to save file with results (i.e. bounding box, confidence level). Invalid in case of camera input.')
|
models/person_detection_mediapipe/mp_persondet.py
CHANGED
@@ -2,7 +2,7 @@ import numpy as np
|
|
2 |
import cv2 as cv
|
3 |
|
4 |
class MPPersonDet:
|
5 |
-
def __init__(self, modelPath, nmsThreshold=0.3, scoreThreshold=0.5, topK=
|
6 |
self.model_path = modelPath
|
7 |
self.nms_threshold = nmsThreshold
|
8 |
self.score_threshold = scoreThreshold
|
|
|
2 |
import cv2 as cv
|
3 |
|
4 |
class MPPersonDet:
|
5 |
+
def __init__(self, modelPath, nmsThreshold=0.3, scoreThreshold=0.5, topK=5000, backendId=0, targetId=0):
|
6 |
self.model_path = modelPath
|
7 |
self.nms_threshold = nmsThreshold
|
8 |
self.score_threshold = scoreThreshold
|
models/pose_estimation_mediapipe/demo.cpp
CHANGED
@@ -33,7 +33,7 @@ private:
|
|
33 |
Mat anchors;
|
34 |
|
35 |
public:
|
36 |
-
MPPersonDet(string modPath, float nmsThresh = 0.
|
37 |
modelPath(modPath), nmsThreshold(nmsThresh),
|
38 |
scoreThreshold(scoreThresh), topK(tok),
|
39 |
backendId(bId), targetId(tId)
|
|
|
33 |
Mat anchors;
|
34 |
|
35 |
public:
|
36 |
+
MPPersonDet(string modPath, float nmsThresh = 0.3, float scoreThresh = 0.5, int tok=5000 , dnn::Backend bId = DNN_BACKEND_DEFAULT, dnn::Target tId = DNN_TARGET_CPU) :
|
37 |
modelPath(modPath), nmsThreshold(nmsThresh),
|
38 |
scoreThreshold(scoreThresh), topK(tok),
|
39 |
backendId(bId), targetId(tId)
|