项目作者: hxtruong6

项目描述 :
Using yolov3 to training detect butterfly
高级语言: C
项目地址: git://github.com/hxtruong6/butterfly-yolov3.git
创建时间: 2019-05-25T06:57:01Z
项目社区:https://github.com/hxtruong6/butterfly-yolov3

开源协议:Other

下载


Project Machine learning

Detect butterfly

  1. Dataset
    In this project, I train 3 kind of butterfly

    • CommonBuckeye
    • MourningCloak
    • ParisPeacock

    Total about 1200 images
    Butterfly images was taken from google and many pages.
    I created 3 utils for getting, converting type image, changing name.

    Script getting image from google image search

  1. var cont=document.getElementsByTagName("body")[0];
  2. var imgs=document.getElementsByTagName("a");
  3. var i=0;var divv= document.createElement("div");
  4. var aray=new Array();var j=-1;
  5. while(++i<imgs.length){
  6. if(imgs[i].href.indexOf("/imgres?imgurl=http")>0){
  7. divv.appendChild(document.createElement("br"));
  8. aray[++j]=decodeURIComponent(imgs[i].href).split(/=|%|&/)[1].split("?imgref")[0];
  9. divv.appendChild(document.createTextNode(aray[j]));
  10. }
  11. }
  12. cont.insertBefore(divv,cont.childNodes[0]);

Script getting image from any page

  1. function getAllImgageSrc() {
  2. let count = 0;
  3. let imgs = "";
  4. document.querySelectorAll("img").forEach(img=>{
  5. imgs+=img.src+'\n'
  6. count++;
  7. })
  8. console.log("Image length: ", count);
  9. console.log(imgs);
  10. }

I used tool Yolo-Annotation-Tool-New to create the bounding box for images

  1. Training
Thank you for sharing <3
  1. Notes
    Some points I got stuck, I’m not sure with others
    • Because I used google colab and got free 12GB GPU to training, So before make command after clone yolov3 project. I changed Makefile file: GPU = 1 and CUDNN=1
    • In butterfly-obj.data file. It will save a backup file and weight after 1000 at fist and 10000 times next by default
    • Because I don’t want save after 10000 times, so I change detector.c in examples folder. *Line 138 change to if(i%500==0 || (i < 1000 && i%100 == 0)){ ...}. It means it will save weights file after 100 times at first and 500 times for second time.
    • I saved backup file and wieghts in backup folder of google colab. So I need to download files before google reset

Finally, this is my notebok: https://colab.research.google.com/drive/1HAc0G3hedpFuJ1XI1fNVZSAYJGiaoCgq?authuser=1#scrollTo=wrI19JfCeyZh

Update

Have a nice day!!!