GithubHelp home page GithubHelp logo

yolov5's Introduction

Yolov5

git clone Yolov5

!git clone https://github.com/ultralytics/yolov5
%cd yolov5
!pip install -r requirements.txt

install pytorch

!pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html

install roboflow

!pip install -q roboflow
from roboflow import Roboflow
rf = Roboflow (model_format="yolov5", notebook="roboflow-yolov5")

get roboflow data

%cd /content
!curl -L "https://public.roboflow.com/ds/K9IjAYLk5y?key=9th6uXdcDR"> roboflow.zip; unzip roboflow.zip; rm roboflow.zip

check data

%cat data.yaml

make custom data

import yaml
with open("data.yaml",'r') as stream:
  num_classes = str(yaml.safe_load(stream)['nc'])
 
from IPython.core.magic import register_line_cell_magic
@register_line_cell_magic
def writetemplate (line, cell):
  with open(line,'w') as f:
    f.write(cell.format(**globals()))

train

%%time
%cd /content/yolov5
!python train.py --img 3200 --batch 32 --epochs 100 --data '../data.yaml' --cfg ./models/custom_yolov5m.yaml --weights '' --name yolov5s_results --cache

check validation

%cd /content/yolov5/
!python val.py --img 3200 --data '../data.yaml' --weights /content/yolov5/runs/train/yolov5s_results/weights/best.pt

detect object

%cd /content/yolov5/
!python detect.py --weights /content/yolov5/runs/train/yolov5s_results/weights/best.pt --img 3200 --conf 0.4 --source /content/yolov5/test_1/images --save-crop

save as zip

!zip -r /content/yolov5/exp.zip /content/yolov5/runs/detect/exp3

yolov5's People

Contributors

yeom-yeom avatar

Watchers

 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.