fix(unraid): restore stable FP32 inference
This commit is contained in:
@@ -44,8 +44,7 @@ class Models:
|
||||
height, width = frame.shape[:2]
|
||||
t0 = time.perf_counter_ns()
|
||||
init_default_scope("mmdet")
|
||||
with torch.autocast(device_type="cuda", dtype=torch.float16):
|
||||
result = inference_detector(self.detector, frame)
|
||||
result = inference_detector(self.detector, frame)
|
||||
pred = result.pred_instances.cpu().numpy()
|
||||
keep = (pred.labels == 0) & (pred.scores >= threshold)
|
||||
boxes = pred.bboxes[keep]
|
||||
@@ -56,8 +55,7 @@ class Models:
|
||||
det_ms = (time.perf_counter_ns() - t0) / 1e6
|
||||
t1 = time.perf_counter_ns()
|
||||
init_default_scope("mmpose")
|
||||
with torch.autocast(device_type="cuda", dtype=torch.float16):
|
||||
pose_results = inference_topdown(self.pose, frame, bboxes=boxes) if len(boxes) else []
|
||||
pose_results = inference_topdown(self.pose, frame, bboxes=boxes) if len(boxes) else []
|
||||
pose_ms = (time.perf_counter_ns() - t1) / 1e6
|
||||
people = []
|
||||
for idx, (box, det_score, sample) in enumerate(zip(boxes, scores, pose_results)):
|
||||
|
||||
Reference in New Issue
Block a user