Skip to content

Commit c764e50

Browse files
authored
Change the default value of topK (#271)
* Change the default value of topK * Change several more default values
1 parent 8bdc41b commit c764e50

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

models/person_detection_mediapipe/demo.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class MPPersonDet {
3131
Mat anchors;
3232

3333
public:
34-
MPPersonDet(string modPath, float nmsThresh = 0.5, float scoreThresh = 0.3, int tok = 1, dnn::Backend bId = DNN_BACKEND_DEFAULT, dnn::Target tId = DNN_TARGET_CPU) :
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) :
3535
modelPath(modPath), nmsThreshold(nmsThresh),
3636
scoreThreshold(scoreThresh), topK(tok),
3737
backendId(bId), targetId(tId)

models/person_detection_mediapipe/demo.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
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.')
3737
parser.add_argument('--nms_threshold', type=float, default=0.3,
3838
help='Usage: Suppress bounding boxes of iou >= nms_threshold. Default = 0.3.')
39-
parser.add_argument('--top_k', type=int, default=1,
39+
parser.add_argument('--top_k', type=int, default=5000,
4040
help='Usage: Keep top_k bounding boxes before NMS.')
4141
parser.add_argument('--save', '-s', action='store_true',
4242
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import cv2 as cv
33

44
class MPPersonDet:
5-
def __init__(self, modelPath, nmsThreshold=0.3, scoreThreshold=0.5, topK=1, backendId=0, targetId=0):
5+
def __init__(self, modelPath, nmsThreshold=0.3, scoreThreshold=0.5, topK=5000, backendId=0, targetId=0):
66
self.model_path = modelPath
77
self.nms_threshold = nmsThreshold
88
self.score_threshold = scoreThreshold

models/pose_estimation_mediapipe/demo.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class MPPersonDet {
3333
Mat anchors;
3434

3535
public:
36-
MPPersonDet(string modPath, float nmsThresh = 0.5, float scoreThresh = 0.3, int tok=1 , dnn::Backend bId = DNN_BACKEND_DEFAULT, dnn::Target tId = DNN_TARGET_CPU) :
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) :
3737
modelPath(modPath), nmsThreshold(nmsThresh),
3838
scoreThreshold(scoreThresh), topK(tok),
3939
backendId(bId), targetId(tId)

0 commit comments

Comments
 (0)