Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Image Size Support for DeepStack Detector #6429

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update DeepStack detector to set width and height from input image size
  • Loading branch information
skrashevich committed May 8, 2023
commit 09ac377648b9759f4ae92613ffb7d0bdebf2eca2
4 changes: 1 addition & 3 deletions frigate/detectors/plugins/deepstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ def __init__(self, detector_config: DeepstackDetectorConfig):
self.api_key = detector_config.api_key
self.labels = detector_config.model.merged_labelmap

self.h = detector_config.model.height
self.w = detector_config.model.width

def get_label_index(self, label_value):
if label_value.lower() == "truck":
label_value = "car"
Expand All @@ -47,6 +44,7 @@ def get_label_index(self, label_value):
def detect_raw(self, tensor_input):
image_data = np.squeeze(tensor_input).astype(np.uint8)
image = Image.fromarray(image_data)
self.w, self.h = image.size
with io.BytesIO() as output:
image.save(output, format="JPEG")
image_bytes = output.getvalue()
Expand Down