function downloadTrainedRAWToRGBNet(url,destination)
% The downloadTrainedRAWToRGBNet function downloads the pretrained 
% RAW-to-RGB network that converts RAW data to an RGB image.
%
% Copyright 2020 The MathWorks, Inc.

filename = 'trainedRAWToRGBNet.mat';
netDirFullPath = destination;
netFileFullPath = fullfile(destination,filename);

if ~exist(netFileFullPath,'file')
    fprintf('Downloading pretrained RAW-to-RGB network.\n');
    fprintf('This can take several minutes to download...\n');
    if ~exist(netDirFullPath,'dir')
        mkdir(netDirFullPath);
    end
    websave(netFileFullPath,url);
    fprintf('Done.\n\n');
else
    fprintf('Pretrained RAW-to-RGB network already exists.\n\n');
end
end