# FaceBoxes **Repository Path**: Levi990223/FaceBoxes ## Basic Information - **Project Name**: FaceBoxes - **Description**: No description available - **Primary Language**: Unknown - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-08-15 - **Last Updated**: 2021-08-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # FaceBoxes 本项目实现了FaceBoxes从GPU到NPU上训练的迁移,源开源代码仓 [FaceBoxes.PyTorch](https://github.com/zisianw/FaceBoxes.PyTorch) ## FaceBoxes Detail 本项目对于FaceBoxes.Pytorch做出了如下更改: 1. 将设备从Nvidia GPU迁移到Huawei NPU上。 2. 在源代码的基础上添加了Apex混合精度进行优化。 3. 在模型迁移到NPU上后一些不支持或性能较低的算子放到CPU上进行规避。 4. 针对测试结果添加了新的评估脚本。 ## Requirements ```shell pip install -r requirements.txt ``` - NPU 配套的run包安装 - Python3.7.5 - PyTorch(NPU版本) - Apex(NPU版本) ### 导入环境变量 ```shell source npu_set_env_new.sh ``` ### 编译 ```shell ./make.sh git clone https://github.com/Levi0223/FDDB_Evaluation.git cd FDDB_Evaluation python3 setup.py build_ext --inplace mv ../convert.py ../split.py ./ ``` ### 准备数据集 1. 下载 [WIDER FACE ](http://mmlab.ie.cuhk.edu.hk/projects/WIDERFace/index.html) 数据集,将图片放在这个目录下: ```shell $FaceBoxes_ROOT/data/WIDER_FACE/images/ ``` 下载转换后的[标注文件](https://drive.google.com/file/d/1-s4QCu_v76yNwR-yXMfGqMGgHQ30WxV2/view),将他们放在这个目录下: ```shell $FaceBoxes_ROOT/data/WIDER_FACE/annotations/ ``` 2. 下载 [FDDB](https://drive.google.com/file/d/17t4WULUDgZgiSy5kpCax4aooyPaz3GQH/view) 数据集,将图片放在这个目录下: ```shell $FaceBoxes_ROOT/data/FDDB/images/ ``` ## Trainning ### 单卡训练 ```shell bash scripts/train_1p.sh ``` ### Test ```shel bash scripts/test.sh ``` ### Evaluate ```shell bash scripts/eval.sh ``` ### 多卡训练 ```shell bash scripts/train_8p.sh ``` ### Test ```shell bash scripts/test.sh ``` ### Evaluate ```shell bash scripts/eval.sh ``` ## Performance | | AP | APEX | lOSS_SCALE | EPOCH | | :-----: | :----: | :--: | :--------: | :---: | | **GPU** | 0.9440 | O2 | 128 | 300 | | **NPU** | 0.9396 | O2 | 128 | 300 |