Skip to content

Commit

Permalink
Fixed Siammask tracker error on grayscale images (#6982)
Browse files Browse the repository at this point in the history
```python
"Exception caught in handler - \"not enough values to unpack (expected 3, got 2)\": Traceback (most recent call last):
 File \"/opt/nuclio/_nuclio_wrapper.py\", line 143, in serve_requests
 await self._handle_event(event)
 File \"/opt/nuclio/_nuclio_wrapper.py\", line 397, in _handle_event
 entrypoint_output = self._entrypoint(self._context, event)
 File \"/opt/nuclio/main.py\", line 29, in handler
 shape, state = context.user_data.model.infer(image, shape, states[i] if i < len(states) else None)
 File \"/opt/nuclio/model_handler.py\", line 56, in infer
 self.config['hp'], device=self.device)
 File \"/opt/nuclio/SiamMask/tools/test.py\", line 152, in siamese_init
 z_crop = get_subwindow_tracking(im, target_pos, p.exemplar_size, s_z, avg_chans)
 File \"/opt/nuclio/SiamMask/tools/test.py\", line 88, in get_subwindow_tracking
 r, c, k = im.shape
ValueError: not enough values to unpack (expected 3, got 2)
```
  • Loading branch information
azhavoro authored Oct 11, 2023
1 parent 5219c8f commit 80daa10
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions changelog.d/20231011_153251_andrey_fix_siammask.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed

- Fixed Siammask tracker error on grayscale images
(<https://github.com/opencv/cvat/pull/6982>)
1 change: 1 addition & 0 deletions serverless/pytorch/foolwood/siammask/nuclio/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def handler(context, event):
shapes = data.get("shapes")
states = data.get("states")
image = Image.open(buf)
image = image.convert("RGB") # to make sure image comes in RGB

results = {
'shapes': [],
Expand Down

0 comments on commit 80daa10

Please sign in to comment.