forked from open-mmlab/OpenPCDet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bash_ready_data.sh
67 lines (56 loc) · 2.81 KB
/
bash_ready_data.sh
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
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
################################
# README
# This .sh file is to:
# 1. Download the client data (if not downloaded)
# 2. Preprocess the client data (downsample + filter the data)
################################
################################
# Setup anaconda3
# https://stackoverflow.com/a/70293309
################################
source ~/anaconda3/bin/activate
conda init bash
echo " "
conda activate openpcdet
################################
# hyperparameters
################################
ORI_PLY_DIR="data_raw/techpartnerfile/techpartnerfile-ply"
PLY_DIR="data_raw/techpartnerfile/preprocessed_techpartnerfile-ply"
LABEL_DIR="data_raw/techpartnerfile/techpartnerfile_label"
################################
# create directory data_raw to store raw data
################################
if [ -d "data_raw" ]; then
echo -e "directory data_raw has been created previously.\n"
else
mkdir -p "data_raw"
echo -e "Created directory data_raw\n"
fi
################################
# Download client dataset (which is preprocessed and augmented)
################################
https://drive.google.com/file/d/1Q9Vy_Gd3OLKXVJ9LO0KatQIfu_sPW3Hs/view?usp=sharing
if [ -d "data_raw/techpartnerfile" ]; then
echo -e "The client data has been downloaded previously.\n"
else
cd "data_raw"
echo -e "The client data zip file does not exists. Downloading now...\n"
# download ply file
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1PEhDVrk0rn1fxMpa_M6TVRzCeG0_x4pT' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1PEhDVrk0rn1fxMpa_M6TVRzCeG0_x4pT" -O "preprocessed_techpartnerfile-ply.zip" && rm -rf /tmp/cookies.txt || exit 1
unzip "preprocessed_techpartnerfile-ply.zip" -d "techpartnerfile" || exit 1
# download labels
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=16SNV_o23LslyjRdM1uoqX7vzt1MsrvI3' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=16SNV_o23LslyjRdM1uoqX7vzt1MsrvI3" -O "techpartnerfile_label.zip" && rm -rf /tmp/cookies.txt || exit 1
unzip "techpartnerfile_label.zip" -d "techpartnerfile" || exit 1
cd ../
echo " "
fi
################################
# Fix the label path name in the json label, in case multiple people did the labelling -> insonsistency in root directory
################################
python3 batch_fix_label.py --ply_dir $PLY_DIR --label_dir $LABEL_DIR || exit 1
################################
# deactivate conda environment
################################
conda deactivate