larryliu0820 commited on
Commit
856bf9b
·
verified ·
1 Parent(s): 499f083

docs: add note about contiguous inputs

Browse files
Files changed (1) hide show
  1. README.md +33 -0
README.md CHANGED
@@ -81,6 +81,39 @@ This model performs **instance segmentation**, outputting both bounding boxes an
81
 
82
  Output includes detection results and mask coefficients.
83
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  ## License
85
 
86
  This model is released under AGPL-3.0 license. See [Ultralytics YOLO26](https://github.com/ultralytics/ultralytics) for more details.
 
81
 
82
  Output includes detection results and mask coefficients.
83
 
84
+
85
+ ## Troubleshooting
86
+
87
+ ### Low confidence / incorrect outputs with non-contiguous inputs
88
+
89
+ If your outputs look wrong (for object-detection models this can show up as all confidences capped around **~0.20 / 20%** and **no detections**), ensure the input tensor passed to ExecuTorch is **contiguous**.
90
+
91
+ Example:
92
+
93
+ ```python
94
+ import torch
95
+
96
+ # img_hwc: float32 HWC image (e.g. RGB) in [0, 1]
97
+ x = torch.from_numpy(img_hwc).permute(2, 0, 1).unsqueeze(0) # NCHW (often non-contiguous)
98
+ x = x.contiguous() # IMPORTANT
99
+
100
+ outputs = method.execute([x])
101
+ ```
102
+
103
+ Detection symptom example (before fix):
104
+
105
+ ```
106
+ Confidence range: [0.0004, 0.2012]
107
+ Detections: 0
108
+ ```
109
+
110
+ After fix (`.contiguous()`):
111
+
112
+ ```
113
+ Confidence range: [0.0001, 0.9589]
114
+ Detections: 12
115
+ ```
116
+
117
  ## License
118
 
119
  This model is released under AGPL-3.0 license. See [Ultralytics YOLO26](https://github.com/ultralytics/ultralytics) for more details.