forked from mlcommons/ck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.bat
42 lines (28 loc) · 1007 Bytes
/
run.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
@echo off
echo =======================================================
set CUR_DIR=%cd%
echo Current path in CM script: %CUR_DIR%
echo.
echo Installing extra requirements (latest versions) ...
echo.
%CM_PYTHON_BIN_WITH_PATH% -m pip install -r %CM_TMP_CURRENT_SCRIPT_PATH%\requirements.txt
echo =======================================================
cd %CM_IPOL_PATH%
echo Current path in CM cache: %cd%
rem Check default images
if "%CM_INPUT_1%" == "" (
set CM_INPUT_1=%CM_TMP_CURRENT_SCRIPT_PATH%\sample-images\1.png
)
if "%CM_INPUT_2%" == "" (
set CM_INPUT_2=%CM_TMP_CURRENT_SCRIPT_PATH%\sample-images\2.png
)
echo Running author's code ...
del /F /Q cm.png
del /F /Q %CUR_DIR%\diff.png
echo.
%CM_PYTHON_BIN_WITH_PATH% main.py --input_0=%CM_INPUT_1% --input_1=%CM_INPUT_2%
IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
rem Copy diff png to current path
copy /B cm.png %CUR_DIR%\diff.png
IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
echo =======================================================