Giter Club home page Giter Club logo

flip-flops's Introduction

Download tập ảnh dép lào

  1. Download trình duyệt google chome
  2. Download driver google chome
  3. Viết chương trình lấy file ảnh từ google images
  4. Viết chương trình chuẩn hóa tên file ảnh
  5. Viết chương trình phân chia 80% ảnh train 20% ảnh test

Gán nhãn cho tập dữ liệu

  1. Cài đặt công cụ labelImg
  2. Tập ảnh
  3. Tập nhãn

Train dữ liệu

  1. download darknet
  2. Đưa dữ liệu ảnh vào /darknet/data/images/
  3. Đưa file tọa độ rectangle vào /darknet/data/labels/
  4. Đưa file train.txt gồm 80% ảnh trong tập dữ liệu và0 /darknet/
  5. Đưa file val.txt gồm 20% ảnh trong tập dữ liệu vào /darknet/
  6. Tạo file yolo.data, yolo.names
  7. Download file darknet53.conv.74
  8. Chỉnh sửa số liệu trong file darknet/cfg/yolov3.cfg ,filter and class
  9. Chỉnh sửa file /darknet/examples/detector.c, tìm đến dòng 138
if(i%2000==0 || (i < 1000 && i%100 == 0))
  1. Bắt đầu train:
./darknet detector train yolo.data cfg/yolov3.cfg darknet53.conv.74

Train dữ liệu trên google colab

  1. Nén darknet thành darknet.zip
  2. Upload lên google drive
  3. Sử dụng [google colab]https://colab.research.google.com() để truy cập
  4. chọn file -> new python 3 Notebooke
  5. chọn runtime -> change runtime type -> đổi None sang GPU
  6. Kết nối đến google drive
from google.colab import drive
drive.mount('/content/drive')

!git clone https://github.com/AlexeyAB/darknet
  
!apt-get update
!apt-get upgrade


!apt-get install build-essential
!apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev

!apt-get install libavcodec-dev libavformat-dev libswscale-d

!apt-get install libopencv-dev

  
%cd darknet

!ls
!sed -i 's/OPENCV=0/OPENCV=1/g' Makefile
!sed -i 's/GPU=0/GPU=1/g' Makefile


!ls
%cd ../
!ls


!apt install g++-5
!apt install gcc-5

!apt update
!apt upgrade


!/usr/local/cuda/bin/nvcc --version

%cd darknet
!make
!wget https://pjreddie.com/media/files/darknet53.conv.74



!rm /content/darknet/backup -r
!ln -s /content/drive/My\ Drive/ML/backup /content/darknet/backup

%cd /content/drive/My\ Drive/ML/
!unzip /content/drive/My\ Drive/ML/darknet.zip

%cd /content/darknet
!./darknet detector train data/phones.data yolo-phones.cfg darknet53.conv.74 -dont_show 
  1. giải nén file zip
%cd /content
!unzip /content/drive/'My Drive'/ML/darknet.zip
%cd /content/darknet
  1. Gán quyền thực thi
!make
!chmod +x ./darknet
  1. Tạo liên kết mềm sang google dive
!rm /content/darknet/backup -r
!ln -s /content/drive/'My Drive'/ML/backup /content/darknet
  1. tiến hanh train
%cd /content/darknet
!./darknet detector train yolo.data cfg/yolov3.cfg backup/yolov3_900.weights
  1. download file weight mới nhất trong thư mục backup

Kiểm thử

  1. Lấy file weight mới nhất trong tập backup ra sung_test
  2. Lấy 1 tấm hình trong tập train ra test thử
  3. Sử dụng lệnh: python YOLO.py -i sung_test.jpg -cl yolo.names -w backup/yolov3.backup -c cfg/yolov3.cfg

flip-flops's People

Contributors

minhdua avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.