icey-zhang / SuperYOLO

SuperYOLO is accepted by TGRS
344 stars 56 forks source link

is there any possible for this to update to yolo11? #132

Closed 4everImmortality closed 1 month ago

4everImmortality commented 1 month ago

hello doctor recently from our school's program, my tutor give me a instruction to update this great rgb-ir model to the newest version with yolo11, and I've got some problem with this, could you please help me to have a look for this. I followed YOLOv5's format, and move the new features from yolo11 to superyolo, and when i use this It tells me that the function MF can not be use in this area image it said that NameError: name 'MF' is not defined. Did you mean: 'F'?

and here is the code after i change that ` def parse_model(d, string, ch, config): # model_dict, input_channels(3) logger.info('\n%3s%18s%3s%10s %-40s%-30s' % ('', 'from', 'n', 'params', 'module', 'arguments'))

max_channels = float("inf")
scales = d.get("sacles")
if scales:
    scale = d.get("scale")
    if not scale:
        scale = tuple(scales.keys())[0]
        logger.warning(f"WARNING ⚠️ no model scale passed. Assuming scale='{scale}'.")
    depth, width, max_channels = scales[scale]

# ##############
anchors, nc, gd, gw = d['anchors'], d['nc'], d['depth_multiple'], d['width_multiple']
na = (len(anchors[0]) // 2) if isinstance(anchors, list) else anchors  # number of anchors
no = na * (nc + 5)  # number of outputs = anchors * (classes + 5)

layers, save, c2 = [], [], ch[-1]  # layers, savelist, ch out
i_shoud_add = 0

stri = string.split('+')
if len(stri) == 2:
    string_1 = stri[0]
    string_2 = stri[1]
    d_ = d[string_1] + d[string_2]
    save.extend([2, 4, 5, 6, 8, 9])  # save some layer of backbone
else:
    d_ = d[stri[-1]]

for i, (f, n, m, args) in enumerate(d_):  # from, number, module, args
    m = eval(m) if isinstance(m, str) else m  # eval strings
    for j, a in enumerate(args):
        try:
            args[j] = eval(a) if isinstance(a, str) else a  # eval strings
        except:
            pass

    n = max(round(n * gd), 1) if n > 1 else n  # depth gain

` I didn't change any cfg file of the model structure and here is the debug content: image I would be very appreciated for all of you gentlemen to help me solve this thank sir in advanced and thank you for everyone who r offering help

4everImmortality commented 1 month ago

I just use default setting yaml, and it still showing that image actually I didn't change any other yaml setting and just update new yolo feature in common.py and it just can not recognize the class MF and after I delete this code, it still can not recognize all the functions in code' if m in []' no matter I import this or not how could this be solved

4everImmortality commented 1 month ago

well after days and nights to test and through the paper and ultraltics new version, I guess I know how to solve that, and I m going to fork this and when I finish this I will update them