def renderIndex(modelNames, numCategories, bins):
    htmlList = []
    htmlList.append('<html><head><style>%s</style><body>' % \
        'span.good {color:green;} span.bad {color:red;} \
        table{border-spacing:10px;}')
    numModels = len(modelNames)
    numCorrect = 1 << numModels
    htmlList.append('<h1>Models comparisons</h1>')
    htmlList.append('Notes:<br/><span class="good">\
        Green means the model gets correct</span><br/>')
    htmlList.append('<span class="bad">\
        Red means the model gets wrong</span>')
    for i in range(numCategories):
        htmlList.append('<h2>%s</h2>' % getCatName(i))
        htmlList.append('<table>')
        for j in range(numCorrect):
            htmlList.append('<tr>')
            binId = numCorrect * i + j
            for k, c in enumerate(getBinName(j)):
                htmlList.append('<td>')
                if c == '1':
                    htmlList.append(
                        '<span class="good">%s</span>' % modelNames[k])
                elif c == '0':
                    htmlList.append(
                        '<span class="bad">%s</span>' % modelNames[k])
                htmlList.append('</td>')
            htmlList.append('<td>%d items</td>' % len(bins[binId]))
            htmlList.append('<td><a href="%s/0.html">link</a></td>' % \
                getName(getCatName(i), getBinName(j)))
            htmlList.append('</tr>')

        htmlList.append('</table>')
    htmlList.append('</head></body></html>')
    return ''.join(htmlList)
dataset/ETHPy150Open renmengye/imageqa-public/src/imageqa_compare.py/renderIndex/original