conda create -n garbage_cls python=3.6
conda activate garbage_cls # or source activate garbage_cls
pip install -r requirements.txt
cd training_scripts/
mkdir data
mkdir model_save
cd data/
Then, Download the garbage dataset
wget https://modelarts-competitions.obs.cn-north-1.myhuaweicloud.com/garbage_classify/dataset/garbage_classify_v2.zip
unzip garbage_classify_v2.zip
rm garbage_classify_v2.zip
Finally, run the pre-processing script
cd ..
python preprocessing.py
python train.py
We also provide the pre-trained model on the garbage dataset, which has top-1
accuracy of 93.66%
and top-5
accuracy of 99.89%
.
cd ..
python app.py
Our deployment actually borrow the help of frp (fast reverse proxy) (in Chinese: 内网穿透).
If both of your port 80
and port 443
are blocked owning to firewall issue, you may check this out for your own WeChat deployment.
We borrow tons of code from the second place solution of garbage classification competition held by Huawei.
[1] Training code base: huawei-garbage
[2] Fast reverse proxy: frp
[3] Mahajan, Dhruv, et al. "Exploring the limits of weakly supervised pretraining." ECCV. 2018.
[4] He, Kaiming, et al. "Deep residual learning for image recognition." CVPR. 2016.
[5] Krizhevsky, Alex, et al. "Imagenet classification with deep convolutional neural networks." NeurIPS. 2012.