Пример #1
0
            model.set_input(data)  # unpack data from data loader
            model.test()  # run inference
            visuals = model.get_current_visuals()  # get image results
            img_path = model.get_image_paths()  # get image paths

            if i % 5 == 0:  # save images to an HTML file
                print('processing (%04d)-th image... %s' % (i, img_path))
            save_images(webpage,
                        visuals,
                        img_path,
                        aspect_ratio=opt.aspect_ratio,
                        width=opt.display_winsize)

            image_list.append(visuals)

        fid.append(get_FIDScore(image_list))
        del image_list

    #import pdb;pdb.set_trace()
    # evaluate by fid score (target -> source)
    ## Your Implementation Here ##
    fid_scoreA = fid[0]
    # evaluate by fid score (source -> target)
    ## Your Implementation Here ##
    fid_scoreB = fid[1]

    print('source-like target / source fid score = %d \n' % (fid_scoreA))
    print('target-like source / target fid score = %d \n' % (fid_scoreB))

    webpage.save()  # save the HTML
Пример #2
0
            model.set_input(data)  # unpack data from data loader
            model.test()           # run inference
            visuals = model.get_current_visuals()  # get image results
            img_path = model.get_image_paths()     # get image paths

            if i % 5 == 0:  # save images to an HTML file
                print('processing (%04d)-th image... %s' % (i, img_path))
            save_images(webpage, visuals, img_path, aspect_ratio=opt.aspect_ratio, width=opt.display_winsize)
            real_list.append(visuals['real'])
            fake_list.append(visuals['fake'])
        
        #fid.append(get_FIDScore(real_list, fake_list))
        fake.append(fake_list)
        real.append(real_list)

         
    #import pdb;pdb.set_trace()
    # evaluate by fid score (target -> source)
    ## Your Implementation Here ##
    #fid_scoreA = fid[0]
    fid_scoreA = get_FIDScore(real[1], fake[0])
    # evaluate by fid score (source -> target)
    ## Your Implementation Here ##
    #fid_scoreB = fid[1]
    fid_scoreB = get_FIDScore(real[0], fake[1])

    print('source-like target / source fid score = %d \n' % (fid_scoreA))
    print('target-like source / target fid score = %d \n' % (fid_scoreB))

    webpage.save()  # save the HTML