function downloadTrainedPix2PixHDNet(url,destination)
% The downloadTrainedPix2PixHDNet function downloads the pretrained 
% Pix2PixHD network that generates synthetic scene images from pixel label
% images.
%
%   Copyright 2019 The MathWorks, Inc.

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

if ~exist(netFileFullPath,'file')
    fprintf('Downloading pretrained Pix2PixHD network for CamVid data.\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 Pix2PixHD network for CamVid data set already exists.\n\n');
end
end