feat: initial HSAP platform
Huaxu Sentinel Active Safety Platform with embedded algorithm code, Docker Compose setup, and vendored dataset scaffolds for clone-and-run. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
32
algorithms/lane_ufld/code/CLRNet-main/scripts/setup_clrnet_env.sh
Executable file
32
algorithms/lane_ufld/code/CLRNet-main/scripts/setup_clrnet_env.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
# Create conda env for CLRNet + MUFLD dataset
|
||||
set -euo pipefail
|
||||
|
||||
ENV_NAME="${CLRNET_ENV_NAME:-clrnet_lane}"
|
||||
CLRNET_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
|
||||
source "$(conda info --base)/etc/profile.d/conda.sh"
|
||||
|
||||
if conda env list | awk '{print $1}' | grep -qx "$ENV_NAME"; then
|
||||
echo "Env $ENV_NAME exists, activate: conda activate $ENV_NAME"
|
||||
else
|
||||
conda create -n "$ENV_NAME" python=3.8 -y
|
||||
fi
|
||||
conda activate "$ENV_NAME"
|
||||
|
||||
# PyTorch (adjust CUDA version to match your driver)
|
||||
pip install torch==1.10.2+cu113 torchvision==0.11.3+cu113 \
|
||||
-f https://download.pytorch.org/whl/cu113/torch_stable.html
|
||||
|
||||
pip install mmcv-full==1.4.0 -f https://download.openmmlab.com/mmcv/dist/cu113/torch1.10/index.html
|
||||
|
||||
pip install -r "$CLRNET_ROOT/requirements.txt"
|
||||
|
||||
cd "$CLRNET_ROOT"
|
||||
python setup.py develop
|
||||
|
||||
echo ""
|
||||
echo "Done. Usage:"
|
||||
echo " conda activate $ENV_NAME"
|
||||
echo " cd $CLRNET_ROOT"
|
||||
echo " python main.py configs/clrnet/clr_resnet18_mufld_smoke.py --gpus 0"
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
# CPU-friendly env for CLRNet ONNX export (no CUDA required for export).
|
||||
set -euo pipefail
|
||||
|
||||
ENV_NAME="${CLRNET_EXPORT_ENV:-clrnet_export}"
|
||||
CLRNET_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
|
||||
source "$(conda info --base)/etc/profile.d/conda.sh"
|
||||
|
||||
if ! conda env list | awk '{print $1}' | grep -qx "$ENV_NAME"; then
|
||||
conda create -n "$ENV_NAME" python=3.8 -y
|
||||
fi
|
||||
conda activate "$ENV_NAME"
|
||||
|
||||
pip install --upgrade pip
|
||||
pip install torch==1.10.2+cpu torchvision==0.11.3+cpu \
|
||||
-f https://download.pytorch.org/whl/cpu/torch_stable.html
|
||||
pip install mmcv-full==1.4.0 -f https://download.openmmlab.com/mmcv/dist/cpu/torch1.10/index.html
|
||||
pip install onnx onnxruntime onnxsim
|
||||
pip install -r "$CLRNET_ROOT/requirements.txt"
|
||||
cd "$CLRNET_ROOT"
|
||||
pip install -e .
|
||||
|
||||
echo ""
|
||||
echo "Export ONNX:"
|
||||
echo " conda activate $ENV_NAME"
|
||||
echo " cd $CLRNET_ROOT"
|
||||
echo " python tools/export_onnx.py --check"
|
||||
Reference in New Issue
Block a user