From ddd4b1b54f3e1f560240cc7bd0d1f1757b9e6873 Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期五, 20 十二月 2019 13:39:21 +0800
Subject: [PATCH] update

---
 gohumantrack/gohumantrack.go |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/gohumantrack/gohumantrack.go b/gohumantrack/gohumantrack.go
index 685ff36..8ef46bf 100644
--- a/gohumantrack/gohumantrack.go
+++ b/gohumantrack/gohumantrack.go
@@ -198,6 +198,16 @@
 	// }(freeFakeImage)
 
 	var fakeImage *ImageHumanTracker
+	for _, v := range imgs {
+		if fakeImage == nil && v != nil {
+			fakeImage = v
+			break
+		}
+	}
+	if fakeImage == nil {
+		logo.Infoln("batch~~~~~~ images slice no images")
+		return nil
+	}
 	for k, v := range imgs {
 		if v == nil {
 			// fake := C.create_fake_image(C.int(wid * hei * chn))
@@ -209,9 +219,6 @@
 			C.fill_images(cImgs, C.int(h.batchSize), C.int(k), unsafe.Pointer(&v.Data[0]), C.int(v.Width), C.int(v.Height), C.int(v.Channel))
 
 		} else {
-			if fakeImage == nil && v != nil {
-				fakeImage = v
-			}
 			logo.Infoln("batch~~~~~~ real image len: ", len(v.Data), " size: ", v.Width, "x", v.Height, "x", v.Channel)
 			C.fill_images(cImgs, C.int(h.batchSize), C.int(k), unsafe.Pointer(&v.Data[0]), C.int(v.Width), C.int(v.Height), C.int(v.Channel))
 		}

--
Gitblit v1.8.0