| | |
| | | "github.com/spf13/viper" |
| | | ) |
| | | |
| | | // GetIpcAddress get ipc |
| | | func GetIpcAddress(shm bool, id string) string { |
| | | if shm { |
| | | return id |
| | | } |
| | | return `ipc:///tmp/` + id + `.ipc` |
| | | } |
| | | |
| | | // SetParams 收集参数 |
| | | func SetParams(param string) { |
| | | RunParams = append(RunParams, param) |
| | | } |
| | | |
| | | // FillParams 填充MapParams |
| | | func FillParams(key, value string) { |
| | | MapParames[key] = value |
| | | } |
| | | |
| | | // GetParams 获取slave params |
| | | func GetParams() *[]string { |
| | | // if len(RunParams) == 0 { |
| | | // for k, v := range MapParames { |
| | | // param := "-" + k + "=" + v |
| | | // RunParams = append(RunParams, param) |
| | | // } |
| | | // } |
| | | // return &RunParams |
| | | |
| | | var params []string |
| | | for _, v := range RunParams { |
| | | params = append(params, v) |
| | | } |
| | | for k, v := range MapParames { |
| | | param := "-" + k + "=" + v |
| | | params = append(params, param) |
| | | } |
| | | return ¶ms |
| | | } |
| | | |
| | | // FindStringInArray find |
| | |
| | | DataPort int //数据端口 |
| | | } |
| | | |
| | | // SDKFaceInfo face |
| | | type SDKFaceInfo struct { |
| | | DetectThrd int |
| | | DetectNum int |
| | | DetectAngle int |
| | | PropThrd int |
| | | ExtractThrd int |
| | | TrackInterval int |
| | | SampleSize int |
| | | } |
| | | |
| | | // SDKCarInfo car |
| | | type SDKCarInfo struct { |
| | | LicenseServerPath string |
| | | Model string |
| | | MaxImageWidth int |
| | | MaxImageHeight int |
| | | } |
| | | |
| | | var ( |
| | | // FSI 同步服务器信息 |
| | | FSI = &FetchServerInfo{ |
| | |
| | | DataPort: 50007, |
| | | } |
| | | |
| | | // SFI 人脸信息 |
| | | SFI = &SDKFaceInfo{ |
| | | DetectThrd: 16, |
| | | DetectNum: 30, |
| | | DetectAngle: 60, |
| | | PropThrd: 16, |
| | | ExtractThrd: 16, |
| | | TrackInterval: 3, |
| | | SampleSize: 720, |
| | | } |
| | | |
| | | // SCI sdkcarinfo |
| | | SCI = &SDKCarInfo{ |
| | | LicenseServerPath: "./vtr.key", |
| | | Model: "./data/model", |
| | | MaxImageWidth: 4096, |
| | | MaxImageHeight: 2160, |
| | | } |
| | | |
| | | // ToRuleIPC to ruleprocess |
| | | ToRuleIPC = "ipc:///tmp/sdk-2-rules-process.ipc" |
| | | |
| | | // RunParams slave进程需要的参数,从master传入 |
| | | RunParams []string |
| | | |
| | | // MapParames 保存参数map,备更新 |
| | | // MapParames map params |
| | | MapParames = make(map[string]string) |
| | | |
| | | // LogFile log |
| | |
| | | ) |
| | | |
| | | const ( |
| | | RuleIPC = "rule-ipc" |
| | | GPU = "gpu" |
| | | SHM = "shm" |
| | | LogIt = "logit" |
| | | ConfigPath = "config-path" |
| | | |
| | | FetchSrvIP = "fetch-server-ip" |
| | | FetchSrvPort = "fetch-server-port" |
| | | FetchSrvHeartbeatPort = "fetch-server-heartbeat-port" |
| | | FetchSrvDataPort = "fetch-server-data-port" |
| | | |
| | | FaceDetectThread = "face-detect-thread" |
| | | FaceDetectNum = "face-detect-num" |
| | | FaceDetectAngle = "face-detect-angle" |
| | | FacePropertyThread = "face-property-thread" |
| | | FaceExtractThread = "face-extract-thread" |
| | | FaceTrackInterval = "face-track-interval" |
| | | FaceTrackSample = "face-track-sample" |
| | | |
| | | CarSDKLicense = "car-sdk-license" |
| | | CarMaxImageWidth = "car-max-image-width" |
| | | CarMaxImageHeight = "car-max-image-height" |
| | | CarSDKModel = "car-sdk-model" |
| | | RuleIPC = "rule-ipc" |
| | | ) |