From 5e850c24897a5eb65941703059a85ead2ea5ff8c Mon Sep 17 00:00:00 2001 From: AlexeyAB Date: Mon, 18 Feb 2019 18:12:05 +0300 Subject: [PATCH] Minor fixes --- src/classifier.c | 2 +- src/detector.c | 4 ++-- src/http_stream.cpp | 4 ++-- src/image.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/classifier.c b/src/classifier.c index 11b6968d004..247d48dad75 100644 --- a/src/classifier.c +++ b/src/classifier.c @@ -156,7 +156,7 @@ void train_classifier(char *datacfg, char *cfgfile, char *weightfile, int *gpus, i = get_current_batch(net); - int calc_topk_for_each = iter_topk + 4 * train_images_num / (net.batch * net.subdivisions); // calculate TOPk for each 4 Epochs + int calc_topk_for_each = iter_topk + 2 * train_images_num / (net.batch * net.subdivisions); // calculate TOPk for each 2 Epochs calc_topk_for_each = fmax(calc_topk_for_each, net.burn_in); calc_topk_for_each = fmax(calc_topk_for_each, 1000); if (i % 10 == 0) { diff --git a/src/detector.c b/src/detector.c index 5524ac19cfd..50711116d05 100644 --- a/src/detector.c +++ b/src/detector.c @@ -289,7 +289,7 @@ void train_detector(char *datacfg, char *cfgfile, char *weightfile, int *gpus, i //if (i % 1000 == 0 || (i < 1000 && i % 100 == 0)) { //if (i % 100 == 0) { - if (i >= (iter_save + 1000)) { + if (i >= (iter_save + 1000) || i % 1000 == 0) { iter_save = i; #ifdef GPU if (ngpus != 1) sync_nets(nets, ngpus, 0); @@ -299,7 +299,7 @@ void train_detector(char *datacfg, char *cfgfile, char *weightfile, int *gpus, i save_weights(net, buff); } - if (i >= (iter_save_last + 100)) { + if (i >= (iter_save_last + 100) || i % 100 == 0) { iter_save_last = i; #ifdef GPU if (ngpus != 1) sync_nets(nets, ngpus, 0); diff --git a/src/http_stream.cpp b/src/http_stream.cpp index 3eb76ac0622..842a736de78 100644 --- a/src/http_stream.cpp +++ b/src/http_stream.cpp @@ -102,7 +102,7 @@ class MJPG_sender SOCKET sock; SOCKET maxfd; fd_set master; - int timeout; // master sock timeout, shutdown after timeout millis. + int timeout; // master sock timeout, shutdown after timeout usec. int quality; // jpeg compression [1..100] int close_all_sockets; @@ -289,7 +289,7 @@ class JSON_sender SOCKET sock; SOCKET maxfd; fd_set master; - int timeout; // master sock timeout, shutdown after timeout millis. + int timeout; // master sock timeout, shutdown after timeout usec. int close_all_sockets; int _write(int sock, char const*const s, int len) diff --git a/src/image.c b/src/image.c index f95b478a948..4002d87e3ce 100644 --- a/src/image.c +++ b/src/image.c @@ -821,7 +821,7 @@ void draw_train_loss(IplImage* img, int img_size, float avg_loss, float max_img_ else cvPutText(img, "- Saved", cvPoint(250, img_size - 10), &font, CV_RGB(255, 255, 255)); - if (mjpeg_port > 0) send_mjpeg(img, mjpeg_port, 2000, 80); + if (mjpeg_port > 0) send_mjpeg(img, mjpeg_port, 200000, 80); } #endif // OPENCV