forked from annesophie96/HNSCC-AI-segmentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
02-configure-environment.bat
56 lines (44 loc) · 1.18 KB
/
02-configure-environment.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
55
56
@echo off
setlocal enabledelayedexpansion
title Environment configurator
if exist .venv\ (
rmdir .venv /s /q
)
::if not exist .venv\Scripts\activate.bat (
py -3.10 -m venv .venv
::)
call .venv\Scripts\activate.bat && where python && py -m pip install --upgrade pip && py -m pip --version && py -m pip install -r requirements.txt
set parentdir=%~dp0
set "parentdir=!parentdir:\=/!"
::echo !parentdir!
set AppDataDir=%LocalAppData%
cd %AppDataDir%
set str1=a
set str2=b
for /d %%d in (*.*) do (
set str1=%%d
if not "x!str1:QuPath=!"=="x!str1!" (
set str2=%%d
set "AppDataDir=!AppDataDir:\=/!"
))
cd !parentdir!
set InputFile=config/default-config.txt
set OutputFile=config/.paquo.toml
set "_strFind=qupath_dir = """
set "_strInsert=qupath_dir = "!AppDataDir!/!str2!""
>"%OutputFile%" (
for /f "usebackq delims=" %%A in ("%InputFile%") do (
if "%%A" equ "%_strFind%" (echo %_strInsert%) else (echo %%A)
)
)
echo Environment setup done!
set /p decide=Would you like to run inference (Y/N)^?
set /a tempvar=0
if "!decide!" equ "y" set /a tempvar=1
if "!decide!" equ "Y" set /a tempvar=1
if !tempvar! equ 1 (
start 03-inference.bat
exit 0
) else (
set /p=Hit ENTER to continue...
)