mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-04 18:25:22 +03:00
Changes to pass lint checks
This commit is contained in:
parent
10155d3b3e
commit
e7436a413c
@ -140,12 +140,13 @@ class OvDetector(DetectionApi):
|
||||
scores = np.max(output_data[:, 4:], axis=1)
|
||||
if len(scores) == 0:
|
||||
return np.zeros((20, 6), np.float32)
|
||||
|
||||
scores = np.expand_dims(scores, axis=1)
|
||||
dets = np.concatenate((output_data, scores), axis=1) # add scores to the last column
|
||||
dets = dets[dets[:,-1] > 0.5,:] # filter out lines with scores below threshold
|
||||
|
||||
ordered = dets[dets[:, -1].argsort()[::-1]][:20] # limit to top 20 scores, descending order
|
||||
# add scores to the last column
|
||||
dets = np.concatenate((output_data, scores), axis=1)
|
||||
# filter out lines with scores below threshold
|
||||
dets = dets[dets[:, -1] > 0.3, :]
|
||||
# limit to top 20 scores, descending order
|
||||
ordered = dets[dets[:, -1].argsort()[::-1]][:20]
|
||||
detections = np.zeros((20, 6), np.float32)
|
||||
i = 0
|
||||
|
||||
@ -170,9 +171,11 @@ class OvDetector(DetectionApi):
|
||||
elif self.ov_model_type == ModelTypeEnum.yolov5:
|
||||
out_tensor = infer_request.get_output_tensor()
|
||||
output_data = out_tensor.data[0]
|
||||
conf_mask = (output_data[:, 4] >= 0.5).squeeze()
|
||||
# filter out lines with scores below threshold
|
||||
conf_mask = (output_data[:, 4] >= 0.3).squeeze()
|
||||
output_data = output_data[conf_mask]
|
||||
ordered = output_data[output_data[:, 4].argsort()[::-1]][:20] # limit to top 20 scores, descending order
|
||||
# limit to top 20 scores, descending order
|
||||
ordered = output_data[output_data[:, 4].argsort()[::-1]][:20]
|
||||
|
||||
detections = np.zeros((20, 6), np.float32)
|
||||
i = 0
|
||||
|
||||
Loading…
Reference in New Issue
Block a user