reid from https://github.com/michuanhaohao/reid-strong-baseline
zhangmeng
2020-01-15 aaa1c01fa7febe0de698b38ddae4cfe5fe7cc4ff
debug
1个文件已修改
22 ■■■■■ 已修改文件
run.go 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
run.go
@@ -1,9 +1,7 @@
package main
import (
    "bufio"
    "context"
    "fmt"
    "io/ioutil"
    "os"
    "strings"
@@ -15,7 +13,6 @@
    "basic.com/valib/gogpu.git"
    "basic.com/pubsub/protomsg.git"
    "basic.com/valib/godraw.git"
    "github.com/gogo/protobuf/proto"
@@ -139,11 +136,6 @@
            }
            s.fnLogger("REID~~~~~~Recv Image:", len(i.Data))
            /////////////////////////////////
            if jpg, err := godraw.ToJpeg(i.Data, int(i.Width), int(i.Height), nil); err == nil {
                ioutil.WriteFile("./pic.jpg", jpg, 0644)
            }
            /////////////////////////////////
            feat := s.handle.Extract2(unsafe.Pointer(&i.Data[0]), int(i.Width), int(i.Height), 3)
            if feat == nil {
                // feat = make([]float32, 1)
@@ -152,20 +144,6 @@
                    s.fnLogger("REID~~~~~~extractor---human_feats------%f", feat[k+2000])
                }
                s.fnLogger("REID~~~~~~Run Reid Use GPU: ", s.gpu)
                /////////////////////////////////
                if f, err := os.Create("./reid-feat.txt"); err == nil {
                    defer f.Close()
                    w := bufio.NewWriter(f)
                    for k, v := range feat {
                        lineStr := fmt.Sprintf("%d->%f", k, v)
                        fmt.Fprintln(w, lineStr)
                    }
                    w.Flush()
                }
                /////////////////////////////////
            }
            buf := float32SliceAsByteSlice(feat)
            ioutil.WriteFile("./reid-feat-byte.txt", buf, 0644)