Jm/update#24
Conversation
fix: align aries2 compiler tutorials
…ror handling for image reading and model inference outputs - Updated NUM_THREADS calculation to handle cases where os.cpu_count() returns None. - Enhanced error handling in visualize.py and inference_mxq.py to raise exceptions when images fail to load or model inference returns no outputs. - Improved mask resizing logic in scale_masks function. - Added type hints for save methods in visualizer classes. - Introduced a new oriented bounding boxes runtime with necessary files and functionalities, including inference, postprocessing, and visualization. - Added Korean and English README files for the oriented bounding boxes runtime tutorial. - Included utility functions for handling oriented bounding boxes and their visualization. - Added a sample image for testing purposes.
…aligned documentation changes
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9509d89806
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return torch.zeros((0, 6 + self.n_extra), dtype=torch.float32, device=self.device) | ||
|
|
||
| box, score, extra = x[:, :4], x[:, 4 : 4 + self.nc], x[:, 4 + self.nc :] | ||
| conf, cls_idx = score.max(dim=1) |
There was a problem hiding this comment.
Preserve multi-label candidates before NMS
When a decoded box has multiple class scores above --conf-thres, this argmax keeps only the best class and discards the rest before class-offset NMS. The prior code expanded every (box, class) pair with torch.nonzero(conf > self.conf_thres), so multi-label YOLO outputs now silently lose valid secondary detections; please keep the multi-label expansion or explicitly change the tutorial to single-label postprocessing.
Useful? React with 👍 / 👎.
| if result is None: | ||
| cv2.imwrite(output_path, img_bgr) | ||
| model.dispose() | ||
| raise SystemExit("No detections found. Saved the original image.") |
There was a problem hiding this comment.
Exit successfully after valid no-detection output
When postprocess returns None (for example on a blank image or a user-supplied high --conf-thres), this branch writes the output image but then raises SystemExit with a string, which Python reports as a non-zero exit status. That makes a valid no-detections run fail in scripts or CI after producing the requested file; return normally, or use SystemExit(0), after cleanup instead.
Useful? React with 👍 / 👎.
| if input_shape[-1] == 3: # channel last -> HWC, e.g. (640, 640, 3) | ||
| target_h, target_w, is_hwc = input_shape[0], input_shape[1], True | ||
| else: # channel first -> CHW, e.g. (3, 640, 640) | ||
| target_h, target_w, is_hwc = input_shape[1], input_shape[2], False |
There was a problem hiding this comment.
Strip batch dimensions before deriving layout
When qbruntime returns a batch-inclusive model input shape, this logic reads the batch dimension as part of the image layout. For example, a trailing-batch HWC shape falls into the CHW branch and uses the channel count as target_w, while a leading-batch shape would use the batch as target_h, so the default inference path letterboxes to the wrong size before calling the NPU. Normalize input_shape by removing any batch dimension before deciding HWC vs CHW.
Useful? React with 👍 / 👎.
No description provided.