main
parent
1dab8ae3e1
commit
c496ffc1ba
5
app.py
5
app.py
|
@ -14,7 +14,6 @@ from multiprocessing import Process, Event
|
|||
|
||||
app = Flask(__name__)
|
||||
|
||||
device_count = torch.cuda.device_count()
|
||||
workers = {}
|
||||
|
||||
@app.route('/start/<id>')
|
||||
|
@ -63,7 +62,6 @@ def worker(id,source,region=None,stream=False):
|
|||
region = 10
|
||||
else:
|
||||
region = int(region)
|
||||
print("GPU device count:", device_count)
|
||||
print("start loading model...",id,source,region)
|
||||
model = YOLO('./best.pt')
|
||||
print("start loaded model!!!")
|
||||
|
@ -95,8 +93,7 @@ def worker(id,source,region=None,stream=False):
|
|||
print("Error opening video stream....")
|
||||
break
|
||||
continue
|
||||
print("device_count",int(id)%device_count)
|
||||
result = model.track(frame,show=False,stream=False,persist=True,device=int(id)%device_count)
|
||||
result = model.track(frame,show=False,stream=False,persist=True,device=int(id)%4)
|
||||
use += " track:"+str((time.time()*1000) - bgn)
|
||||
del(ret)
|
||||
del(frame)
|
||||
|
|
Loading…
Reference in New Issue