Pytorch-Implemented-Deep-SR-ITM
Pytorch-Implemented-Deep-SR-ITM copied to clipboard
about the first_step
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!
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
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 ?
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.