@yeongjaeyou/claude-code-config 0.21.0 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# ML Guidelines
|
|
2
|
+
|
|
3
|
+
Best practices for Machine Learning and Computer Vision tasks.
|
|
4
|
+
|
|
5
|
+
## Batch Inference Efficiency
|
|
6
|
+
|
|
7
|
+
Maximize GPU utilization with batch processing during validation/evaluation.
|
|
8
|
+
|
|
9
|
+
### Do's
|
|
10
|
+
- DataLoader + batch processing required for large-scale inference
|
|
11
|
+
- batch_size based on GPU memory (24GB -> 64, 12GB -> 32)
|
|
12
|
+
- Optimize memory with torch.no_grad() + autocast combination
|
|
13
|
+
|
|
14
|
+
### Don'ts
|
|
15
|
+
- Calling predict_file() repeatedly in file-by-file loop (GPU utilization < 10%)
|
|
16
|
+
- Using single-file API for large-scale inference
|
|
17
|
+
|
|
18
|
+
### Pattern
|
|
19
|
+
|
|
20
|
+
```python
|
|
21
|
+
# Good: Batch inference (GPU utilization 90%+)
|
|
22
|
+
loader = DataLoader(dataset, batch_size=64, num_workers=8)
|
|
23
|
+
with torch.no_grad():
|
|
24
|
+
for batch in loader:
|
|
25
|
+
outputs = model(batch["image"].cuda())
|
|
26
|
+
|
|
27
|
+
# Bad: File-by-file (only for demo/interactive use)
|
|
28
|
+
for f in files:
|
|
29
|
+
predictor.predict_file(f) # Excessive GPU idle time
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## BGR vs RGB Color Format
|
|
33
|
+
|
|
34
|
+
OpenCV uses BGR, matplotlib uses RGB. Keep BGR during annotation, convert to RGB only before display.
|
|
35
|
+
|
|
36
|
+
```python
|
|
37
|
+
# Correct pattern
|
|
38
|
+
img = cv2.imread(path) # BGR
|
|
39
|
+
img = annotator.annotate(img, detections) # Keep BGR
|
|
40
|
+
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) # Convert just before display
|
|
41
|
+
plt.imshow(img)
|
|
42
|
+
|
|
43
|
+
# Wrong pattern (causes color inversion)
|
|
44
|
+
img = cv2.imread(path)
|
|
45
|
+
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) # Too early
|
|
46
|
+
img = annotator.annotate(img, detections) # BGR colors on RGB image -> inverted
|
|
47
|
+
plt.imshow(img)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Ultralytics WandB Integration
|
|
51
|
+
|
|
52
|
+
Ultralytics YOLO has WandB disabled by default.
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
yolo settings wandb=True # Enable
|
|
56
|
+
yolo settings wandb=False # Disable
|
|
57
|
+
```
|
|
@@ -279,5 +279,5 @@ When translating into Korean:
|
|
|
279
279
|
## Related Guidelines
|
|
280
280
|
|
|
281
281
|
- [ID Reference](./id-reference.md) - GitHub/TaskMaster ID conventions
|
|
282
|
-
- [
|
|
282
|
+
- [ML Guidelines](./ml-guidelines.md) - ML/CV batch inference, color formats, Ultralytics
|
|
283
283
|
- [PRD Guide](./prd-guide.md) - PRD template for TaskMaster
|
package/package.json
CHANGED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# CV Guidelines
|
|
2
|
-
|
|
3
|
-
Best practices for Computer Vision tasks.
|
|
4
|
-
|
|
5
|
-
## BGR vs RGB Color Format
|
|
6
|
-
|
|
7
|
-
**Key Point**: OpenCV uses BGR, matplotlib uses RGB. When annotating with OpenCV-based libraries like supervision, keep the image in BGR format and convert to RGB only right before displaying with matplotlib.
|
|
8
|
-
|
|
9
|
-
```python
|
|
10
|
-
# Correct pattern
|
|
11
|
-
img = cv2.imread(path) # BGR
|
|
12
|
-
img = annotator.annotate(img, detections) # Keep BGR
|
|
13
|
-
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) # Convert just before display
|
|
14
|
-
plt.imshow(img)
|
|
15
|
-
|
|
16
|
-
# Wrong pattern (causes color inversion)
|
|
17
|
-
img = cv2.imread(path)
|
|
18
|
-
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) # Too early
|
|
19
|
-
img = annotator.annotate(img, detections) # BGR colors on RGB image -> inverted
|
|
20
|
-
plt.imshow(img)
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Ultralytics WandB Integration
|
|
24
|
-
|
|
25
|
-
Ultralytics YOLO has WandB disabled by default.
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
yolo settings wandb=True # Enable
|
|
29
|
-
yolo settings wandb=False # Disable
|
|
30
|
-
```
|