# illeagl_construction **Repository Path**: hlobin/illeagl_construction ## Basic Information - **Project Name**: illeagl_construction - **Description**: illegal construction detection - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2023-10-20 - **Last Updated**: 2024-03-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # illegal_construction ## 介绍 **基于无人机图像的违章搭建识别** ## 环境安装 以下安装和配置操作均在ubuntu-20.04(磁盘分配需要>=40G)测试通过 ``` sudo apt install gcc make libpcre3 libpcre3-dev openssl libssl-dev zlib1g zlib1g-dev git clone https://gitee.com/no3xcus3/illeagl_construction.git ``` ## 1. Python - 下载miniconda ```bash cd ~ wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py38_4.10.3-Linux-x86_64.sh bash ~/Miniconda3-py38_4.10.3-Linux-x86_64.sh 配置源请参考: [conda] https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/ [pip] https://mirrors.tuna.tsinghua.edu.cn/help/pypi/ ``` - 下载所需的python环境 ``` ## 在安装完conda后,此处需要先重启一下终端 conda create -n ic-py38 python=3.8 conda activate ic-py38 ## 保证目录是在~/illegal_constructions/下面 pip install -r ./src/model/requirements.txt ``` ## 2. Rabbitmq - 安装docker ``` sudo apt-get remove docker docker-engine docker.io containerd runc sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" sudo apt-get -y update sudo apt-get -y install docker-ce ``` - 添加docker权限 ``` sudo groupadd docker sudo gpasswd -a $USER docker newgrp docker conda activate ic-py38 ``` - 安装rabbitmq并生成SSL密钥证书 ``` docker pull rabbitmq:management cd ./scripts python start_rabbit_docker.py ``` - rabbitmq用户权限 ``` # 进入容器内部 docker exec -it rabbitmq bash # 创建一个用户名为rabbit,密码为rabbit的用户 rabbitmqctl add_user rabbit rabbit # 设置用户权限为超级管理员 rabbitmqctl set_user_tags rabbit administrator # 授权远程访问 rabbitmqctl set_permissions -p / rabbit "." "." ".*" # 退出容器 exit # 重启rabbitmq docker restart rabbitmq ``` ## 3. nginx-rtmp ``` ## 此时目录应该与illegal_construction同级 ## 环境准备 git clone https://github.com/arut/nginx-rtmp-module.git wget https://nginx.org/download/nginx-1.22.0.tar.gz tar xzvf nginx-1.22.0.tar.gz ## 编译 cd ./nginx-1.22.0 ./configure --add-module=../nginx-rtmp-module sudo make && sudo make install ## 此时目录应该在illegal_constructions下面 ## 同时illegal_constructions/scripts/nginx.conf里的内容也需要修改,需要将里面的d505-1修改为你的主机名 sudo cp ./scripts/nginx.conf /usr/local/nginx/conf/nginx.conf sudo /usr/local/nginx/sbin/nginx -s reload ## 安装ffmpeg sudo apt-get install ffmpeg ``` ## 4. 运行 - 首先按照填写配置文件 ./src/sdk/config.ini - 使用Pyinstaller打包 ``` cd ./src/sdk pyinstaller -F run.py ``` - 运行二进制文件 ``` ## 若服务器重启过,则在运行run文件前,请先启动一下nginx,命令如下: ## sudo /usr/local/nginx/sbin/nginx export DISPLAY=:0.0 (服务器无图形化界面,可以不执行此命令) cd ./dist ./run --config ../config.ini ```