def renderHtml(
                inputData,
                targetData,
                questionIdict,
                ansIdict,
                urlDict,
                topK=10,
                modelOutputs=None,
                modelNames=None,
                questionIds=None):
    imgPerPage = 1000
    if inputData.shape[0] < imgPerPage:
        return [renderSinglePage(
                    inputData,
                    targetData,
                    questionIdict,
                    ansIdict,
                    urlDict,
                    iPage=0,
                    numPages=1,
                    topK=topK,
                    modelOutputs=modelOutputs,
                    modelNames=modelNames, 
                    questionIds=questionIds)]
    else:
        result = []
        numPages = int(np.ceil(inputData.shape[0] / float(imgPerPage)))
        for i in range(numPages):
            start = imgPerPage * i
            end = min(inputData.shape[0], imgPerPage * (i + 1))
            if modelOutputs is not None:
                modelOutputSlice = []
                for j in range(len(modelNames)):
                    modelOutputSlice.append(modelOutputs[j][start:end])
            else:
                modelOutputSlice = None
            page = renderSinglePage(
                        inputData[start:end],
                        targetData[start:end],
                        questionIdict,
                        ansIdict,
                        urlDict, 
                        iPage=i,
                        numPages=numPages,
                        topK=topK,
                        modelOutputs=modelOutputSlice,
                        modelNames=modelNames,
                        questionIds=questionIds[start:end])
            result.append(page)
        return result
dataset/ETHPy150Open renmengye/imageqa-public/src/imageqa_render.py/renderHtml/original