function downloadTrainedDayDuskGeneratorNet(url,destination)
% The downloadTrainedDayDuskGeneratorNet function downloads the pretrained 
% UNIT generator network that translates day images into dusk images and
% vice versa.
%
% Copyright 2020 The MathWorks, Inc.

[~,name,~] = fileparts(url);
netDirFullPath = destination;
netZipFileFullPath = fullfile(destination,[name '.zip']);
netMATFileFullPath = fullfile(destination,[name '.mat']);
if ~exist(netMATFileFullPath,'file')
    if ~exist(netZipFileFullPath,'file')
        fprintf('Downloading pretrained UNIT generator network for CamVid day to dusk data.\n');
        fprintf('This can take several minutes to download...\n');
        if ~exist(netDirFullPath,'dir')
            mkdir(netDirFullPath);
        end
        websave(netZipFileFullPath,url);
        fprintf('Done.\n\n');
    end
    unzip(netZipFileFullPath,netDirFullPath)
else
    fprintf('Pretrained UNIT generator network for CamVid day to dusk data set already exists.\n\n');
end
end