Skip to content

Grayscale v7#6

Open
Sumered wants to merge 28 commits intomasterfrom
grayscale-v7
Open

Grayscale v7#6
Sumered wants to merge 28 commits intomasterfrom
grayscale-v7

Conversation

@Sumered
Copy link

@Sumered Sumered commented Dec 8, 2022

Update to yolov5v7 of branch grayscale, with rgb/grayscale switcher


def parse_model(d, ch): # model_dict, input_channels(3)
# Parse a YOLOv5 model.yaml dictionary
ch = [1] #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

input_channels(3) -> 1


[[17, 20, 23], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
]
ch: 1 No newline at end of file

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

# Build strides, anchors
m = self.model[-1] # Detect()

ch = 1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why override anyway here ?

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.')

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()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty Compose ?


# HSV color-space
augment_hsv(img, hgain=hyp['hsv_h'], sgain=hyp['hsv_s'], vgain=hyp['hsv_v'])
if self.rgb_mode:

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

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants