JunyaoHu / common_metrics_on_video_quality

You can easily calculate FVD, PSNR, SSIM, LPIPS for evaluating the quality of generated or predicted videos.
200 stars 8 forks source link

read #11

Closed ucasyjz closed 6 months ago

ucasyjz commented 6 months ago

How can I read a mp4 file from a path, not directly generate a tensor, can you give me a implementation code

JunyaoHu commented 6 months ago

用opencv或者mediapy之类的都可以啊,只要最后转换成0-1之内的要求的tensor格式就行

opencv读视频就是一帧一帧读然后append在一起,mediapy就是直接读,正常的视频怎么读就怎么读,可能最多就是chw和hwc通道要换换顺序而已

Opencv or mediapy can be used, as long as the final conversion to 0-1 within the required tensor format on the line

opencv reading video means reading frame by frame and then appending together, mediapy can read it directly

maybe at most CHW and HWC channels order is needed to change right

JunyaoHu commented 6 months ago

Do you still need demo code? @yang326922943