torch
parent
a54d47c3c1
commit
c96c2a0b6f
15
app.py
15
app.py
|
@ -11,18 +11,6 @@ from multiprocessing import Process, Event
|
|||
|
||||
import torch
|
||||
|
||||
device_count = 0
|
||||
|
||||
if torch.cuda.is_available():
|
||||
device_count = torch.cuda.device_count()
|
||||
print("GPU is available.")
|
||||
print("GPU device count:", torch.cuda.device_count())
|
||||
print("GPU device Current:", torch.cuda.current_device())
|
||||
print("GPU device name:", torch.cuda.get_device_name(torch.cuda.current_device()))
|
||||
else:
|
||||
print("GPU is not available.")
|
||||
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
workers = {}
|
||||
|
@ -73,7 +61,8 @@ def worker(id,source,region=None,stream=False):
|
|||
model = YOLO('./best.pt')
|
||||
balls = {}
|
||||
count = 0
|
||||
print(source)
|
||||
device_count = torch.cuda.device_count()
|
||||
print(device_count,source)
|
||||
try:
|
||||
cap = cv2.VideoCapture(source)
|
||||
if not cap.isOpened():
|
||||
|
|
Loading…
Reference in New Issue