function out = getYOLOv2

%   Copyright 2018-2021 The MathWorks, Inc.

% return a trained series network object for Yolo network
if  ~exist('yolov2ResNet50VehicleExample.mat','file')
    % Download pretrained detector.
    disp('Downloading pretrained detector (98 MB)...');
    pretrainedURL = 'https://www.mathworks.com/supportfiles/vision/data/yolov2ResNet50VehicleExample.mat';
    websave('yolov2ResNet50VehicleExample.mat',pretrainedURL);
end
nnet = load('yolov2ResNet50VehicleExample.mat');
out = nnet.detector.Network;

end
