williamfzc / stagesepx

detect stages in video automatically
MIT License
434 stars 125 forks source link

optional compare algo #136

Closed williamfzc closed 4 years ago

williamfzc commented 4 years ago
            for part_index, (each_start, each_end) in enumerate(zip(src, target)):
                part_ssim = toolbox.compare_ssim(each_start, each_end)
                if part_ssim < ssim:
                    ssim = part_ssim

                # mse is very sensitive
                part_mse = toolbox.calc_mse(each_start, each_end)
                if part_mse > mse:
                    mse = part_mse

                part_psnr = toolbox.calc_psnr(each_start, each_end)
                if part_psnr > psnr:
                    psnr = part_psnr
                logger.debug(
                    f"part {part_index}: ssim={part_ssim}; mse={part_mse}; psnr={part_psnr}"
                )

by default we use the minimum one sometimes it is not a proper way