| | |
| | | } |
| | | |
| | | // MasterRole master |
| | | func MasterRole(ctx context.Context) { |
| | | func MasterRole(ctx context.Context) bool { |
| | | reaper(ctx) |
| | | |
| | | util.InitDBAPI() |
| | |
| | | } |
| | | logo.Infof("START %d PROC %d SDK %s ID %s\n", k, pid, v.IpcId, v.SdkType) |
| | | } |
| | | return true |
| | | } |
| | |
| | | ) |
| | | |
| | | // SingleRole 单进程 |
| | | func SingleRole(ctx context.Context, typ string, ipcID string, gpu int, shm bool) { |
| | | func SingleRole(ctx context.Context, typ string, ipcID string, gpu int, shm bool) bool { |
| | | util.InitDBAPI() |
| | | |
| | | ret := false |
| | | if typ == util.FeatAll { // run all proc per proc |
| | | |
| | | allProc(ctx, gpu, shm) |
| | | ret = allProc(ctx, gpu, shm) |
| | | } else if typ == util.FeatFace || typ == util.FeatYolo { // run all face sdk |
| | | |
| | | sdkProc(ctx, typ, gpu, shm) |
| | | ret = sdkProc(ctx, typ, gpu, shm) |
| | | } else { // run one sdk per proc, typ is facedetect/yolodetect/facecompare etc. id is ipc |
| | | slaveProc(ctx, typ, ipcID, gpu, shm) |
| | | ret = slaveProc(ctx, typ, ipcID, gpu, shm) |
| | | } |
| | | |
| | | return ret |
| | | } |
| | | |
| | | func sdkProc(ctx context.Context, typ string, gpu int, shm bool) { |