-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grayscale v7 #6
base: master
Are you sure you want to change the base?
Grayscale v7 #6
Conversation
QoL-grayscale
Mistakes saved during validation
Update requirements.txt
Fixed loss.py for newer torch, fixed typo in hyps
@@ -298,11 +301,13 @@ def _from_yaml(self, cfg): | |||
|
|||
def parse_model(d, ch): # model_dict, input_channels(3) | |||
# Parse a YOLOv5 model.yaml dictionary | |||
ch = [1] #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comment (maybe use passed value instead of overriding it)
@@ -298,11 +301,13 @@ def _from_yaml(self, cfg): | |||
|
|||
def parse_model(d, ch): # model_dict, input_channels(3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
input_channels(3) -> 1
@@ -46,3 +46,4 @@ head: | |||
|
|||
[[17, 20, 23], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5) | |||
] | |||
ch: 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add to other yamls if required
@@ -188,6 +188,9 @@ def __init__(self, cfg='yolov5s.yaml', ch=3, nc=None, anchors=None): # model, i | |||
|
|||
# Build strides, anchors | |||
m = self.model[-1] # Detect() | |||
|
|||
ch = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why override anyway here ?
@@ -466,6 +521,7 @@ def parse_opt(known=False): | |||
parser.add_argument('--save-period', type=int, default=-1, help='Save checkpoint every x epochs (disabled if < 1)') | |||
parser.add_argument('--seed', type=int, default=0, help='Global training seed') | |||
parser.add_argument('--local_rank', type=int, default=-1, help='Automatic DDP Multi-GPU argument, do not modify') | |||
parser.add_argument('--rgb-mode', action='store_true', help='train model in rgb mode, with image_channels=3.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not working now due to ch = 1
overrides in model / many places
# ], p=0.7), | ||
# A.Cutout(always_apply=False, p=0.7, num_holes=32, max_h_size=8, max_w_size=8) | ||
# ], bbox_params=A.BboxParams(format='yolo', label_fields=['class_labels'])) | ||
self.transform = A.Compose() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty Compose ?
@@ -695,7 +707,8 @@ def __getitem__(self, index): | |||
nl = len(labels) # update after albumentations | |||
|
|||
# HSV color-space | |||
augment_hsv(img, hgain=hyp['hsv_h'], sgain=hyp['hsv_s'], vgain=hyp['hsv_v']) | |||
if self.rgb_mode: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it true in grayscale or not ?
if not matched_detections.__contains__(detection_index): | ||
wrong_detections.append(detections_batch[detection_index]) | ||
|
||
all_mistakes = wrong_detections + wrong_detections_labels + not_detected_targets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe draw different mistakes with different colors ?
Update to yolov5v7 of branch grayscale, with rgb/grayscale switcher