reid from https://github.com/michuanhaohao/reid-strong-baseline
zhangmeng
2020-01-11 bdf3ad71583fb4ef100d3819ecdae8fd9f70083e
debug split
3个文件已修改
20 ■■■■ 已修改文件
csrc/reid.cpp 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
goreid.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
run.go 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
csrc/reid.cpp
@@ -125,9 +125,9 @@
        }
    }
    for (int k = 0; k < 3; ++k) {
        printf("--extractor---human_feats------%f",feature[k+2000]);
    }
    // for (int k = 0; k < 3; ++k) {
    //     printf("--extractor---human_feats------%f",feature[k+2000]);
    // }
    printf("\n\n\n\n\n----------------------------------------------------------------------------\n");
goreid.go
@@ -23,7 +23,7 @@
    handle unsafe.Pointer
}
// NewReID new reid
// NewSDK new reid
func NewSDK(gpu int, module string) *ReID {
    cmodule := C.CString(module)
    defer C.free(unsafe.Pointer(cmodule))
run.go
@@ -15,7 +15,6 @@
type reid struct {
    handle   *ReID
    list     *sdkhelper.LockList
    fnLogger func(...interface{})
    ipc string
@@ -46,7 +45,7 @@
    gpuM := sdkhelper.Atoi(cfg.Param[sGPU])
    rGPU := 0
    rGPU := gpu
    if rGPU == -1 {
        rGPU = gogpu.ValidGPU(gpuM + 512)
@@ -56,8 +55,6 @@
        return nil
    }
    rGPU = 0
    handle := NewSDK(rGPU, cfg.Param[sModel])
    if handle == nil {
        fn("Reid SDK Create Error When New SDK")
@@ -66,7 +63,6 @@
    return &reid{
        handle:   handle,
        list:     sdkhelper.NewLockList(6),
        fnLogger: fn,
        ipc: cfg.Param[sIPC],
@@ -107,7 +103,11 @@
            feat := s.handle.Extract2(unsafe.Pointer(&i.Data[0]), int(i.Width), int(i.Height), 3)
            if feat == nil {
                feat = make([]float32, 1)
            } else {
                for k := 0; k < 3; k++ {
                    s.fnLogger("REID~~~~~~extractor---human_feats------%f", feat[k+2000])
                }
            }
            buf := float32SliceAsByteSlice(feat)
            c.Send(buf)