From 42afe772d51ed54f3a643dd306d1deb6dae0892c Mon Sep 17 00:00:00 2001 From: Birk Stoveland Date: Sun, 23 Jul 2023 15:09:12 +0200 Subject: [PATCH] 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 --- ultralytics/nn/tasks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ultralytics/nn/tasks.py b/ultralytics/nn/tasks.py index 036c9f9..95c4d34 100644 --- a/ultralytics/nn/tasks.py +++ b/ultralytics/nn/tasks.py @@ -699,10 +699,12 @@ def parse_model(d, ch, verbose=True): # model_dict, input_channels(3) args = [ch[f]] elif m is Concat: 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]) if m is Segment: 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: c2 = ch[f]