Update tasks.py to allow custom RTEDTRDecoder arguments (#3872)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
single_channel
Birk Stoveland 1 year ago committed by GitHub
parent 793443a452
commit 42afe772d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -699,10 +699,12 @@ def parse_model(d, ch, verbose=True): # model_dict, input_channels(3)
args = [ch[f]] args = [ch[f]]
elif m is Concat: elif m is Concat:
c2 = sum(ch[x] for x in f) c2 = sum(ch[x] for x in f)
elif m in (Detect, Segment, Pose, RTDETRDecoder): elif m in (Detect, Segment, Pose):
args.append([ch[x] for x in f]) args.append([ch[x] for x in f])
if m is Segment: if m is Segment:
args[2] = make_divisible(min(args[2], max_channels) * width, 8) args[2] = make_divisible(min(args[2], max_channels) * width, 8)
elif m is RTDETRDecoder: # special case, channels arg must be passed in index 1
args.insert(1, [ch[x] for x in f])
else: else:
c2 = ch[f] c2 = ch[f]

Loading…
Cancel
Save