From dda993f3dd3c753dfd580d485b39c1001830fee4 Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Thu, 22 Feb 2018 19:54:40 +0000
Subject: [PATCH] Use half_float16 instead of float32 if defined both CUDNN and CUDNN_HALF. Use Tensor Cores.

---
 src/demo.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/demo.c b/src/demo.c
index 49e08c2..9c3fea4 100644
--- a/src/demo.c
+++ b/src/demo.c
@@ -49,6 +49,7 @@
 static float *avg;
 
 void draw_detections_cv(IplImage* show_img, int num, float thresh, box *boxes, float **probs, char **names, image **alphabet, int classes);
+void show_image_cv_ipl(IplImage *disp, const char *name, const char *out_filename, int http_stream_port);
 image get_image_from_stream_resize(CvCapture *cap, int w, int h, IplImage** in_img);
 IplImage* in_img;
 IplImage* det_img;
@@ -115,7 +116,8 @@
     return (double)time.tv_sec + (double)time.tv_usec * .000001;
 }
 
-void demo(char *cfgfile, char *weightfile, float thresh, int cam_index, const char *filename, char **names, int classes, int frame_skip, char *prefix)
+void demo(char *cfgfile, char *weightfile, float thresh, int cam_index, const char *filename, char **names, int classes, 
+	int frame_skip, char *prefix, char *out_filename, int http_stream_port)
 {
     //skip = frame_skip;
     image **alphabet = load_alphabet();
@@ -125,7 +127,7 @@
     demo_classes = classes;
     demo_thresh = thresh;
     printf("Demo\n");
-    net = parse_network_cfg(cfgfile);
+    net = parse_network_cfg_custom(cfgfile, 1);
     if(weightfile){
         load_weights(&net, weightfile);
     }
@@ -194,7 +196,7 @@
 
             if(!prefix){                
 				//show_image(disp, "Demo");
-				show_image_cv_ipl(show_img, "Demo");
+				show_image_cv_ipl(show_img, "Demo", out_filename, http_stream_port);
                 int c = cvWaitKey(1);
                 if (c == 10){
                     if(frame_skip == 0) frame_skip = 60;
@@ -244,7 +246,7 @@
     }
 }
 #else
-void demo(char *cfgfile, char *weightfile, float thresh, int cam_index, const char *filename, char **names, int classes, int frame_skip, char *prefix)
+void demo(char *cfgfile, char *weightfile, float thresh, int cam_index, const char *filename, char **names, int classes, int frame_skip, char *prefix, char *out_filename, int http_stream_port)
 {
     fprintf(stderr, "Demo needs OpenCV for webcam images.\n");
 }

--
Gitblit v1.10.0