mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
Merge pull request #909 from jing-vision/master
classifier.c - set batch=1 in "predict", "demo" and "try" mode.
This commit is contained in:
@ -598,7 +598,7 @@ void validate_classifier_multi(char *datacfg, char *filename, char *weightfile)
|
|||||||
|
|
||||||
void try_classifier(char *datacfg, char *cfgfile, char *weightfile, char *filename, int layer_num)
|
void try_classifier(char *datacfg, char *cfgfile, char *weightfile, char *filename, int layer_num)
|
||||||
{
|
{
|
||||||
network net = parse_network_cfg(cfgfile);
|
network net = parse_network_cfg_custom(cfgfile, 1);
|
||||||
if(weightfile){
|
if(weightfile){
|
||||||
load_weights(&net, weightfile);
|
load_weights(&net, weightfile);
|
||||||
}
|
}
|
||||||
@ -679,7 +679,7 @@ void try_classifier(char *datacfg, char *cfgfile, char *weightfile, char *filena
|
|||||||
|
|
||||||
void predict_classifier(char *datacfg, char *cfgfile, char *weightfile, char *filename, int top)
|
void predict_classifier(char *datacfg, char *cfgfile, char *weightfile, char *filename, int top)
|
||||||
{
|
{
|
||||||
network net = parse_network_cfg(cfgfile);
|
network net = parse_network_cfg_custom(cfgfile, 1);
|
||||||
if(weightfile){
|
if(weightfile){
|
||||||
load_weights(&net, weightfile);
|
load_weights(&net, weightfile);
|
||||||
}
|
}
|
||||||
@ -868,7 +868,7 @@ void threat_classifier(char *datacfg, char *cfgfile, char *weightfile, int cam_i
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//cap = cvCaptureFromCAM(cam_index);
|
//cap = cvCaptureFromCAM(cam_index);
|
||||||
cap = get_capture_webcam(filename);
|
cap = get_capture_webcam(cam_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
int top = option_find_int(options, "top", 1);
|
int top = option_find_int(options, "top", 1);
|
||||||
@ -1004,7 +1004,7 @@ void gun_classifier(char *datacfg, char *cfgfile, char *weightfile, int cam_inde
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//cap = cvCaptureFromCAM(cam_index);
|
//cap = cvCaptureFromCAM(cam_index);
|
||||||
cap = get_capture_webcam(filename);
|
cap = get_capture_webcam(cam_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
int top = option_find_int(options, "top", 1);
|
int top = option_find_int(options, "top", 1);
|
||||||
@ -1069,7 +1069,7 @@ void demo_classifier(char *datacfg, char *cfgfile, char *weightfile, int cam_ind
|
|||||||
{
|
{
|
||||||
#ifdef OPENCV
|
#ifdef OPENCV
|
||||||
printf("Classifier Demo\n");
|
printf("Classifier Demo\n");
|
||||||
network net = parse_network_cfg(cfgfile);
|
network net = parse_network_cfg_custom(cfgfile, 1);
|
||||||
if(weightfile){
|
if(weightfile){
|
||||||
load_weights(&net, weightfile);
|
load_weights(&net, weightfile);
|
||||||
}
|
}
|
||||||
@ -1084,7 +1084,7 @@ void demo_classifier(char *datacfg, char *cfgfile, char *weightfile, int cam_ind
|
|||||||
cap = get_capture_video_stream(filename);
|
cap = get_capture_video_stream(filename);
|
||||||
}else{
|
}else{
|
||||||
//cap = cvCaptureFromCAM(cam_index);
|
//cap = cvCaptureFromCAM(cam_index);
|
||||||
cap = get_capture_webcam(filename);
|
cap = get_capture_webcam(cam_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
int top = option_find_int(options, "top", 1);
|
int top = option_find_int(options, "top", 1);
|
||||||
|
Reference in New Issue
Block a user