-
Notifications
You must be signed in to change notification settings - Fork 15
/
run_workflow_predictOnly_fast.bat
54 lines (43 loc) · 1.59 KB
/
run_workflow_predictOnly_fast.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
43
44
45
46
47
48
49
50
51
52
53
54
@ECHO off
SETLOCAL ENABLEEXTENSIONS
SetLocal EnableDelayedExpansion
:: batch script to run prediction with postprocessing
:: parameters are coming
set root_dir=%1
set images_dir=%2
if "%3"=="" (
echo "using default MaskRCNN folder: %root_dir%\Mask_RCNN-2.1"
set "pathToInsert=%root_dir%\Mask_RCNN-2.1"
) else (
set pathToInsert=%3
)
set workflow_root=%root_dir%\kaggle_workflow
set maskrcnn_scripts=%root_dir%\FinalModel
set maskrcnn=%workflow_root%\maskrcnn
set outputs_dir=%workflow_root%\outputs
set input_images=%outputs_dir%\images
:: check inputs
echo "root_dir: " %root_dir%
echo "workflow_root:" %workflow_root%
echo "maskrcnn_scripts: " %maskrcnn_scripts%
echo "maskrcnn: " %maskrcnn%
echo "outputs_dir: " %outputs_dir%
echo "images_dir: " %images_dir%
:: set pythonpath
rem Check if pathToInsert is not already in pythonpath
echo %pythonpath%|find /i "%pathToInsert%">nul || set pythonpath=%pythonpath%;%pathToInsert%
echo "pythonpath: " %pythonpath%
:: copy user test images to our expected images folder
echo "COPYING USER IMAGES TO %outputs_dir%\images:"
mkdir "%outputs_dir%/images"
copy %images_dir%\*.* %outputs_dir%\images\*
echo "COPYING DONE"
:: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
::::::::::::::::::: MRCNN presegmentation :::::::::::::::::::
echo "PRESEGMENTATION (maskrcnn):"
python %maskrcnn_scripts%\\segmentation.py %maskrcnn%\config\predict\presegment.json
IF %ERRORLEVEL% NEQ 0 (
echo ERROR: "Error during pre-segmentation"
exit /B 1
)
echo "PRESEGMENTATION DONE"