forked from microsoft/lamar-benchmark
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun_anonymization.sh
More file actions
executable file
·44 lines (34 loc) · 1.33 KB
/
run_anonymization.sh
File metadata and controls
executable file
·44 lines (34 loc) · 1.33 KB
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
#!/bin/bash
# Flags and arguments:
# --capture_path : path capture directory
# --session_id : name of the session to anonymize, if not set, anonymization is done on whole capture folder
# --apikey : apikey for BrighterAI
# --sequential : work on images sequentially, supported only for BrighterAI
# --inplace : save images inplace, otherwise they will be saved in a separate {location}/anonymization_{method} folder
# --overwrite : overwrite existing anonymization folder, only works if inplace flag is NOT set
if [ -z "$CAPTURE_DIR" ]; then
echo "[ERROR] CAPTURE_DIR env var not set. Make sure to export CAPTURE_DIR=/path/to/data/root."
exit 1
fi
if [ -z "$LOCATION" ]; then
echo "[ERROR] LOCATION env var not set. Make sure to export LOCATION=location."
exit 1
fi
CAPTURE="${CAPTURE_DIR}/${LOCATION}"
echo "You are running with parameters: "
echo " Capture: ${CAPTURE}"
read -p "Do you want to continue? (y/n): " answer
if [[ ! "$answer" =~ ^[Yy]$ ]]; then
echo "Execution aborted."
exit 1
fi
echo "Running run_image_anonymization on $LOCATION ..."
python3 -m scantools.run_image_anonymization \
--capture_path "$CAPTURE" \
--inplace \
#--session_id "spot_2023-12-08-11-13" \
#--apikey "apikey" \
#--sequential \
#--inplace \
#--overwrite \
echo "Done, run_image_anonymization completed on $LOCATION."