# gaofen-commit **Repository Path**: xiangsanliu/gaofen-commit ## Basic Information - **Project Name**: gaofen-commit - **Description**: No description available - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2021-09-22 - **Last Updated**: 2023-03-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # gaofen-commit > ❗️ 以下内容基于 ubuntu / macOS, windows不适用 ❗️ ### 1. 准备 ```shell # 安装依赖 sudo apt install build-essential cmake curl ca-certificates libjpeg-dev libpng-dev ffmpeg libsm6 libxext6 # 在项目目录安装 conda bash ./anaconda.sh -b -p ./conda source ./conda/bin/activate conda install pytorch=1.8.1 torchvision cudatoolkit=10.1 -c pytorch -y pip install mmcv-full==1.7.0 -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.8/index.html pip install matplotlib prettytable pip install opencv-python tifffile einops tqdm scikit-image # 准备训练好的weight 文件 mkdir pretrained && cd pretrained wget http://172.27.157.42:8083/segformer_b4.pt wget http://172.27.157.42:8083/best_ckpt.pt ``` 然后执行命令: ```shell python run.py ${input_path} ${output_path} ``` ### 2. 本地build docker * 安装docker * 安装 nvidia-docker2 ```shell distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \ && curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - \ && curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list sudo apt-get update sudo apt-get install -y nvidia-docker2 sudo systemctl restart docker ``` * build image: ```shell docker build -t gaofentest/test:${version} . ``` * 编译好后 ```shell # ❗️ 自行替换中文内容为实际路径 ❗️ docker run --rm --gpus all \ -v /测试图片所在目录:/input_path \ -v /预测输出目录:/output_path \ gaofentest/test:${version} ``` ### 3. 本次比赛所需docker知识学习路径 * docker安装[教程](https://www.runoob.com/docker/docker-tutorial.html) * 完成[阿里云天池入门比赛](https://tianchi.aliyun.com/competition/entrance/231759/information),以及相关教程