浏览代码

Finalized and tested yolo3-tiny

tobychui 3 年之前
父节点
当前提交
9937f2dc4d
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 2 0
      mod/neuralnet/neuralnet.go
  2. 1 1
      web/UnitTest/backend/image.classify.js

+ 2 - 0
mod/neuralnet/neuralnet.go

@@ -2,6 +2,7 @@ package neuralnet
 
 import (
 	"errors"
+	"log"
 	"os/exec"
 	"path/filepath"
 	"runtime"
@@ -105,6 +106,7 @@ func AnalysisPhotoYOLO3(filename string) ([]*ImageClass, error) {
 	networkConf := "cfg/yolov3.cfg"
 	if !filesystem.FileExists(filepath.Join(filepath.Dir(darknetBinary), "yolov3.weight")) {
 		//yolo3 weight not exists. Switch to yolov3_tiny (default, recommended)
+		log.Println("[neuralnet] yolo3.weight not found. Using yolo3-tiny.weight instead")
 		pretrainWeight = "yolov3-tiny.weights"
 		networkConf = "cfg/yolov3-tiny.cfg"
 	}

+ 1 - 1
web/UnitTest/backend/image.classify.js

@@ -7,7 +7,7 @@ function main(){
     http.download("https://cdn.pixabay.com/photo/2017/03/28/12/10/chairs-2181947_960_720.jpg", "tmp:/", "classify.jpg");
 
     //Get image classification, will take a bit time
-    var results = imagelib.classify("tmp:/classify.jpg", "darknet19"); 
+    var results = imagelib.classify("tmp:/classify.jpg", "yolo3"); 
     var responses = [];
     for (var i = 0; i < results.length; i++){
         responses.push({