- 1. General Download Script
- 2. DownloadVOC2007
- 3. DownloadCOCO
- 4. Proxy Setup Script
- 5. Proxy Setup in Container
- 6. Conda Environment Setup for MonoGS and 3DGS
1. General Download Script Link to heading
Example for downloading CUDA 12.2 toolkit
#!/bin/bash
# ๐ฏ Target download URL
URL="https://developer.download.nvidia.cn/compute/cuda/12.2.2/local_installers/cuda_12.2.2_535.104.05_linux.run"
# ๐ Filename
FILENAME=$(basename "$URL")
# ๐ Infinite retry for download (supports resuming from interruption)
while true; do
echo "๐ Starting download (will auto-resume if interrupted): $FILENAME"
# Use wget -c to enable resuming
wget -c "$URL"
# โ
Check if download was successful
if [ $? -eq 0 ]; then
echo "โ
Download successful: $FILENAME"
break
else
echo "โณ Download interrupted, retrying in 5 seconds..."
sleep 5 # โณ Wait for 5 seconds before retrying to avoid network issues
fi
done
2. DownloadVOC2007 Link to heading
#!/bin/bash
# ๐ Get the script's directory
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
# ๐ Create directory to save data
TARGET_DIR="$SCRIPT_DIR/VOC2007"
mkdir -p "$TARGET_DIR"
cd "$TARGET_DIR"
# ๐ Define download URLs
VOC_TRAINVAL_URL="http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar"
VOC_TEST_URL="http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtest_06-Nov-2007.tar"
VOC_DEVKIT_URL="http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCdevkit_08-Jun-2007.tar"
# โฌ๏ธ Download files (supports resuming)
echo "๐ Downloading VOCtrainval_06-Nov-2007.tar..."
wget -c "$VOC_TRAINVAL_URL"
echo "๐ Downloading VOCtest_06-Nov-2007.tar..."
wget -c "$VOC_TEST_URL"
echo "๐ Downloading VOCdevkit_08-Jun-2007.tar..."
wget -c "$VOC_DEVKIT_URL"
# ๐ฆ Extract files
echo "๐ Extracting VOCtrainval_06-Nov-2007.tar..."
tar -xvf VOCtrainval_06-Nov-2007.tar
rm VOCtrainval_06-Nov-2007.tar # ๐๏ธ Delete the tar file after extracting
echo "๐ Extracting VOCtest_06-Nov-2007.tar..."
tar -xvf VOCtest_06-Nov-2007.tar
rm VOCtest_06-Nov-2007.tar # ๐๏ธ Delete the tar file after extracting
echo "๐ Extracting VOCdevkit_08-Jun-2007.tar..."
tar -xvf VOCdevkit_08-Jun-2007.tar
rm VOCdevkit_08-Jun-2007.tar # ๐๏ธ Delete the tar file after extracting
# ๐ Print completion message
echo "โ
VOC 2007 dataset download, extraction, and cleanup completed!"
3. DownloadCOCO Link to heading
#!/bin/bash
# ๐ Create image data directory
mkdir -p images
cd images
# โฌ๏ธ Download COCO image data
echo "๐ Downloading COCO training set (train2017.zip)..."
wget -c http://images.cocodataset.org/zips/train2017.zip
echo "๐ Downloading COCO validation set (val2017.zip)..."
wget -c http://images.cocodataset.org/zips/val2017.zip
echo "๐ Downloading COCO test set (test2017.zip)..."
wget -c http://images.cocodataset.org/zips/test2017.zip
# ๐ฆ Extract COCO image data
echo "๐ Extracting train2017.zip..."
unzip train2017.zip && rm -f train2017.zip
echo "๐ Extracting val2017.zip..."
unzip val2017.zip && rm -f val2017.zip
echo "๐ Extracting test2017.zip..."
unzip test2017.zip && rm -f test2017.zip
# ๐ Download COCO annotation data
cd ..
mkdir -p annotations
cd annotations
echo "๐ Downloading COCO annotation data (annotations_trainval2017.zip)..."
wget -c http://images.cocodataset.org/annotations/annotations_trainval2017.zip
# ๐ Extract COCO annotation data
echo "๐ Extracting annotations_trainval2017.zip..."
unzip annotations_trainval2017.zip && rm -f annotations_trainval2017.zip
# โ
Task completed
echo "๐ COCO2017 dataset download, extraction, and cleanup completed!"
4. Proxy Setup Script Link to heading
#!/bin/bash
# Set proxy address
SOCKS5_PROXY="socks5://127.0.0.1:10808"
HTTP_PROXY="http://127.0.0.1:10809"
HTTPS_PROXY="http://127.0.0.1:10809"
# Set environment variables so all tools (curl, wget, apt, docker) use the proxy
export HTTP_PROXY=$HTTP_PROXY
export HTTPS_PROXY=$HTTPS_PROXY
export ALL_PROXY=$SOCKS5_PROXY
export http_proxy=$HTTP_PROXY
export https_proxy=$HTTPS_PROXY
export all_proxy=$SOCKS5_PROXY
echo "โ
Proxy environment variables set"
# Configure Conda proxy
echo "๐ง Configuring Conda proxy..."
conda config --set proxy_servers.http $HTTP_PROXY
conda config --set proxy_servers.https $HTTPS_PROXY
echo "โ
Conda proxy configured"
# Configure Pip proxy
echo "๐ง Configuring Pip proxy..."
pip config set global.proxy $HTTP_PROXY
echo "โ
Pip proxy configured"
# Configure Git proxy
echo "๐ง Configuring Git proxy..."
git config --global http.proxy $HTTP_PROXY
git config --global https.proxy $HTTPS_PROXY
echo "โ
Git proxy configured"
# Configure APT proxy
echo "๐ง Configuring APT proxy..."
cat <<EOF | tee /etc/apt/apt.conf.d/proxy.conf
Acquire::http::Proxy "$HTTP_PROXY";
Acquire::https::Proxy "$HTTPS_PROXY";
EOF
echo "โ
APT proxy configured"
# Check proxy settings
echo "๐ Verifying proxy settings..."
echo "๐น Conda proxy: $(conda config --show proxy_servers | grep proxy)"
echo "๐น Pip proxy: $(pip config list | grep proxy)"
echo "๐น Git proxy (HTTP): $(git config --global --get http.proxy)"
echo "๐น Git proxy (HTTPS): $(git config --global --get https.proxy)"
echo "๐น APT proxy: $(cat /etc/apt/apt.conf.d/proxy.conf)"
# Test proxy functionality
echo "๐ Testing proxy access to Google..."
curl_test=$(curl -I https://www.google.com 2>/dev/null | head -n 1)
if [[ "$curl_test" =~ "200 OK" || "$curl_test" =~ "200 Connection established" ]]; then
echo "โ
Proxy set up successfully, network is working!"
exit 0
else
echo "โ Proxy setup failed, please check network or proxy server!"
exit 1
fi
5. Proxy Setup in Container Link to heading
#!/bin/bash
# Set proxy addresses
SOCKS5_PROXY="socks5://127.0.0.1:10808"
HTTP_PROXY="http://127.0.0.1:10809"
HTTPS_PROXY="http://127.0.0.1:10809"
echo "โ
Proxy environment variables have been set"
# Configure Conda proxy
echo "๐ง Configuring Conda proxy..."
conda config --set proxy_servers.http $HTTP_PROXY
conda config --set proxy_servers.https $HTTPS_PROXY
echo "โ
Conda proxy has been configured"
# Configure Pip proxy
echo "๐ง Configuring Pip proxy..."
pip config set global.proxy $HTTP_PROXY
echo "โ
Pip proxy has been configured"
# Configure Git proxy
echo "๐ง Configuring Git proxy..."
git config --global http.proxy $HTTP_PROXY
git config --global https.proxy $HTTPS_PROXY
echo "โ
Git proxy has been configured"
# Configure APT proxy
echo "๐ง Configuring APT proxy..."
cat <<EOF | tee /etc/apt/apt.conf.d/proxy.conf
Acquire::http::Proxy "$HTTP_PROXY";
Acquire::https::Proxy "$HTTPS_PROXY";
EOF
echo "โ
APT proxy has been configured"
# Verify proxy settings
echo "๐ Verifying proxy configuration..."
echo "๐น Conda proxy: $(conda config --show proxy_servers | grep proxy)"
echo "๐น Pip proxy: $(pip config list | grep proxy)"
echo "๐น Git proxy (HTTP): $(git config --global --get http.proxy)"
echo "๐น Git proxy (HTTPS): $(git config --global --get https.proxy)"
echo "๐น APT proxy: $(cat /etc/apt/apt.conf.d/proxy.conf)"
# Test if the proxy works
echo "๐ Testing proxy access to Google..."
curl_test=$(curl -I https://www.google.com 2>/dev/null | head -n 1)
if [[ "$curl_test" =~ "200 OK" || "$curl_test" =~ "200 Connection established" ]]; then
echo "โ
Proxy setup successful, network is working!"
exit 0
else
echo "โ Proxy setup failed, please check network or proxy server!"
exit 1
fi
6. Conda Environment Setup for MonoGS and 3DGS Link to heading
#!/bin/bash
# Define the environment name
ENV_NAME="MonoGS-3DGS"
# Create the Conda environment
echo "๐ง Creating Conda environment: $ENV_NAME"
conda create --name $ENV_NAME python=3.8 -y
# Activate the environment
echo "๐ง Activating Conda environment: $ENV_NAME"
conda activate $ENV_NAME
# Install the required dependencies
echo "๐ง Installing dependencies for MonoGS and 3DGS"
conda install -c conda-forge pytorch torchvision cudatoolkit=12.2 -y
conda install -c conda-forge opencv -y
conda install -c conda-forge matplotlib -y
conda install -c conda-forge scikit-learn -y
# Task completed
echo "โ
Conda environment setup completed!"