Skip to content

Commit 20f386b

Browse files
committed
cleanup and documentation
1 parent 95a766c commit 20f386b

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,21 @@ This repository is an implementation of Nodes that interact with the Zauberzeug
77

88
This node is used to train Yolov5 Models in the Learning Loop. It is based on [this image](https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel-23-07.html) running Python 3.10.
99

10+
## Hyperparameters
11+
12+
We support all native hyperparameters of YOLOv5 (cf. `hyp_det.yaml` / `hyp_cla.yaml` for reference).
13+
In addition, we support the following hyperparameters:
14+
15+
- `epochs`: The number of epochs to train the model.
16+
- `detect_nms_conf_thres`: The confidence threshold for the NMS during inference and validation (not relevant for training).
17+
- `detect_nms_iou_thres`: The IoU threshold for the NMS during inference and validation (not used for training).
18+
19+
Further, we support the following hyperparameters for point detection:
20+
21+
- `reset_points`: Whether to reset the size of the points after data augmentation.
22+
- `point_sizes_by_id`: A dictionary that maps from point category uuids to the size of the points in the output (fractional size 0-1).
23+
- `flip_label_pairs`: A list of pairs of point uuids that should be swapped when a horizontal flip is applied during data augmentation.
24+
1025
## Images
1126

1227
Trainer Docker-Images are published on https://hub.docker.com/r/zauberzeug/yolov5-trainer

trainer/app_code/yolov5/utils/dataloaders.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -788,10 +788,9 @@ def __getitem__(self, index):
788788
if reset_points and len(self.point_sizes_by_id) > 0:
789789
for label in labels:
790790
if label[0] in self.point_sizes_by_id:
791-
target_point_size_px = self.point_sizes_by_id[label[0]]
792-
# target_point_size_px = 10
793-
label[3] = target_point_size_px # / self.img_size
794-
label[4] = target_point_size_px # / self.img_size
791+
target_point_size_fraction = self.point_sizes_by_id[label[0]]
792+
label[3] = target_point_size_fraction
793+
label[4] = target_point_size_fraction
795794

796795
labels_out = torch.zeros((nl, 6))
797796
if nl:

trainer/hyp_det.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ copy_paste: 0.0
3434

3535
#own parameters
3636
epochs: 2000
37-
reset_points: false
3837
detect_nms_conf_thres: 0.2
3938
detect_nms_iou_thres: 0.45
40-
#
39+
4140
#extra point parameters (not directly used by yolov5 but by the trainer logic)
41+
reset_points: false
4242
point_sizes_by_id: "" # e.g "1111-2222-3333-4444:0.03,5555-6666-7777-8888:0.05"
4343
flip_label_pairs: "" # e.g "1111-2222-3333-4444:5555-6666-7777-8888"

0 commit comments

Comments
 (0)