Skip to content

Commit

Permalink
Fixes (#13990)
Browse files Browse the repository at this point in the history
* Fix ROCm input name

* Fix incorrect parsing of None
  • Loading branch information
NickM-27 authored Sep 26, 2024
1 parent a559518 commit a65aaab
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
5 changes: 3 additions & 2 deletions frigate/detectors/plugins/rocm.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@ def __init__(self, detector_config: ROCmDetectorConfig):

def detect_raw(self, tensor_input):
model_input_name = self.model.get_parameter_names()[0]
model_input_name = self.model.get_inputs()[0].name
model_input_shape = self.model.get_inputs()[0].shape
model_input_shape = tuple(
self.model.get_parameter_shapes()[model_input_name].lens()
)

tensor_input = cv2.dnn.blobFromImage(
tensor_input[0],
Expand Down
35 changes: 20 additions & 15 deletions frigate/events/maintainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,22 +163,27 @@ def handle_object_detection(
)
)

attributes = [
(
None
if event_data["snapshot"] is None
else {
"box": to_relative_box(
width,
height,
a["box"],
),
"label": a["label"],
"score": a["score"],
}
try:
attributes = [
(
None
if event_data["snapshot"] is None
else {
"box": to_relative_box(
width,
height,
a["box"],
),
"label": a["label"],
"score": a["score"],
}
)
for a in event_data["snapshot"]["attributes"]
]
except TypeError:
logger.warning(
f"Failed to parse attributes of event data, event data is {event_data}"
)
for a in event_data["snapshot"]["attributes"]
]

# keep these from being set back to false because the event
# may have started while recordings and snapshots were enabled
Expand Down

0 comments on commit a65aaab

Please sign in to comment.