-
Notifications
You must be signed in to change notification settings - Fork 0
/
fetch_api.bat
51 lines (41 loc) · 960 Bytes
/
fetch_api.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
@echo off
set repo=https://github.com/omothm/torch-api
set tempdir=apitemp
set finaldest=torchserver\torchapi
echo Fetching API repo...
mkdir %tempdir%
cd %tempdir%
set error=0
git clone --depth=1 %repo% || set error=1
cd ..
if %error% equ 1 (
echo Error cloning. Terminating...
goto cleanup
)
echo Removing old repo...
rmdir /S /Q %finaldest%
echo Adding new repo...
mkdir %finaldest%
move /Y %tempdir%\torch-api\torchapi %finaldest% || set error=1
if %error% equ 1 (
echo Error in the repo. The repo structure is invalid. Terminating...
goto cleanup
)
if exist models (
echo Detected tensorflow model files, no need to pull and compile again.
) else (
git clone --depth 1 https://github.com/tensorflow/models/
pip install cython
pip install pycocotools
cd models
cd research
protoc object_detection/protos/*.proto --python_out=.
pip install .
cd ..
cd ..
)
:cleanup
echo Cleaning up...
rmdir /S /Q %tempdir%
echo Done.
exit /B %error%