-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f3ba6c
commit f0aa293
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
classdef DownloadDeeplabV3PlusFixture < matlab.unittest.fixtures.Fixture | ||
% DownloadDeeplabFixture A fixture for calling downloadPretrainedDeepLabV3Plus if | ||
% necessary. This is to ensure that this function is only called once | ||
% and only when tests need it. It also provides a teardown to return | ||
% the test environment to the expected state before testing. | ||
|
||
% Copyright 2021 The MathWorks, Inc | ||
|
||
properties(Constant) | ||
DeeplabV3DataDir = fullfile(getRepoRoot(),'model') | ||
end | ||
|
||
properties | ||
DeeplabV3Exist (1,1) logical | ||
end | ||
|
||
methods | ||
function setup(this) | ||
this.DeeplabV3Exist = exist(fullfile(this.DeeplabV3DataDir,'deepLabV3Plus-voc.mat'),'file')==2; | ||
|
||
% Call this in eval to capture and drop any standard output | ||
% that we don't want polluting the test logs. | ||
if ~this.DeeplabV3Exist | ||
evalc('helper.downloadPretrainedDeepLabv3Plus();'); | ||
end | ||
end | ||
|
||
function teardown(this) | ||
if this.DeeplabV3Exist | ||
delete(fullfile(this.DeeplabV3DataDir,'deepLabV3Plus-voc.mat')); | ||
end | ||
end | ||
end | ||
end |