Pytorch-Implemented-Deep-SR-ITM icon indicating copy to clipboard operation
Pytorch-Implemented-Deep-SR-ITM copied to clipboard

about the first_step

Open ZeldaM1 opened this issue 4 years ago • 3 comments

Hi Since we can konw from the original implement that the author used ffmpeg to translate mp4 to yuv, but the train_dataset is in yuv format and packed into .mat file, how can we translate the single yuv file to [png] as the first step you proposed ?

Thanks!

ZeldaM1 avatar Mar 28 '20 13:03 ZeldaM1

Hi! You should probably need to use a matlab script to transform the data. Here's a simple demo script. Simple modification and debug would be necessary.

%% 
clear; clc;
tic;
SDR_data = load('test\\testset_SDR.mat');
SDR_data = SDR_data.SDR;
% SDR_data = load('SDR_youtube_80.mat');
% SDR_data = SDR_data.SDR_data;
% save
N = size(SDR_data, 4);
for i = 1:N
    disp(i);
    img = SDR_data(:, :, :, i);
    imwrite(img, ['testset_SDR\\', sprintf('%06d.png', i)]);
end
toc;
%% 
clear; tic; 
HDR_data = load('test\\testset_HDR.mat');
HDR_data = HDR_data.HDR;
% HDR_data = load('HDR_youtube_80.mat');
% HDR_data = HDR_data.HDR_data;
% save
N = size(HDR_data, 4);
for i = 1:N
    disp(i);
    img = HDR_data(:, :, :, i);
    imwrite(img, ['testset_HDR\\', sprintf('%06d.png', i)]);
end

greatwallet avatar Apr 03 '20 08:04 greatwallet

Hi, thanks for sharing! But this seems that you just saved frames from .yuv file into .png, and screen can't display them properly in this way. I mean, how can we make the conversion from yuv to rgb and display them like the normal pictures ?

ZeldaM1 avatar Apr 03 '20 15:04 ZeldaM1

Hi, thanks for sharing! But this seems that you just saved frames from .yuv file into .png, and screen can't display them properly in this way. I mean, how can we make the conversion from yuv to rgb and display them like the normal pictures ?

Maybe you can ues "rgb2 = ycbcr2rgb(ycbcr);" with matlab.

ChesterZero avatar Jun 12 '20 01:06 ChesterZero