Dominic  Feeney

Dominic Feeney

1625828340

Efficient implementation of YOLOV5 in TensorFlow2

Yolov5

YoloV5 implemented by TensorFlow2 , with support for training, evaluation and inference.

NOT perfect project currently, but I will continue to improve this, so you might want to watch/star this repo to revisit. Any contribution is highly welcomed

Key Features

  • minimal Yolov5 by pure tensorflow2
  • yaml file to configure the model
  • custom data training
  • mosaic data augmentation
  • label encoding by iou or wh ratio of anchor
  • positive sample augment
  • multi-gpu training
  • detailed code comments
  • full of drawbacks with huge space to improve

#machine learning #tensorflow #tensorflow2 #yolov5

What is GEEK

Buddha Community

Efficient implementation of YOLOV5 in TensorFlow2
Dominic  Feeney

Dominic Feeney

1625828340

Efficient implementation of YOLOV5 in TensorFlow2

Yolov5

YoloV5 implemented by TensorFlow2 , with support for training, evaluation and inference.

NOT perfect project currently, but I will continue to improve this, so you might want to watch/star this repo to revisit. Any contribution is highly welcomed

Key Features

  • minimal Yolov5 by pure tensorflow2
  • yaml file to configure the model
  • custom data training
  • mosaic data augmentation
  • label encoding by iou or wh ratio of anchor
  • positive sample augment
  • multi-gpu training
  • detailed code comments
  • full of drawbacks with huge space to improve

#machine learning #tensorflow #tensorflow2 #yolov5

Husam Abdullah

1604215960

A PyTorch implementation of YOLOv5

A PyTorch implementation of YOLOv5.

This repository has two features:

  • It is pure python code and can be run immediately using PyTorch 1.4 without build
  • Simplified construction and easy to understand how the model works

The model is based on ultralytics’ repo,

and the code is using the structure of TorchVision.

Requirements

  • Windows or Linux, with Python ≥ 3.6
  • PyTorch** ≥ 1.4.0**
  • matplotlib - visualizing images and results
  • pycocotools - for COCO dataset and evaluation; Windows version is here

There is a problem with pycocotools for Windows. See Issue #356.

Besides, it’s better to remove the prints in pycocotools.

optional:

  • nvidia dali (Linux) - a faster data loader

Datasets

This repository supports VOC and COCO datasets.

If you want to train your own dataset, you may:

  • write the correponding dataset code
  • convert your dataset to COCO-style

PASCAL VOC 2012 (download): http://host.robots.ox.ac.uk/pascal/VOC/voc2012/

MS COCO 2017http://cocodataset.org/

Nvidia DALI is strongly recommended. It’s much faster than the original data loader.

Currently this repository supports COCO-style dataset with DALI.

Training

Train on COCO dataset, using 1 GPU (if you wanna use 2 GPUs, set --nproc_per_node=2):

python -m torch.distributed.launch --nproc_per_node=1 --use_env train.py --use-cuda --dali --mosaic \
--epochs 190 --data-dir "./data/coco2017" --ckpt-path "yolov5s_coco.pth"

A more concrete modification is in run.sh.

To run it:

bash ./run.sh

If you are using PyTorch ≥ 1.6.0 and RTX series GPUs, the code will enable automatic mixed training (AMP).

Demo and Evaluation

  • Run demo.ipynb.
  • Modify the parameters in eval.ipynb to test the model.

Performance

Test on COCO 2017 val set, on a single RTX 2080Ti GPU:

The weights is from ultralytics’ repo.

modelbbox APFPSparamsYOLOv5s36.14107.5M

GitHub

#machine learning #pytorch #yolov5 #python

YOLOv5 Controversy — Is YOLOv5 Real?

Apr 23rd, 2020 — YOLOv4 was released…

…June 10th 2020, YOLOv5 was also released.

Marvelous ain’t it…at how fast we are progressing in our research and technology. I mean to get the next generation of the popular object detection framework so soon after its predecessor was just released. Is YOLOv5 really here or is it a ruse ? We’ll investigate the evidence as objectively as possible, right now in this article, so stay tuned.

Image for post

For those who don’t know what YOLO is, it a real-time object detection framework and stands for You Only Look Once. Meaning the image is only passed once through the FCNN or fully convolutional neural network. I will not go into the technical details of how YOLO works, as I’ve already have 2 videos on my YouTube Channel explained YOLOv1 originated by Joseph Redmon et. Al. all the way to YOLOv4 upgrade by Bochkovskiy et. al.

_For those of you are interested in my course, there will be a link in the description where you can enroll in the full YOLOv4 course when it gets released. We cover the implementation of YOLOv4, training and inference as well as building cross platform object detection apps using PyQT. _Click HERE

Part 1 — What has Occurred.

Okay, so back to YOLOv5. Glenn Jocher the founder and CEO of Ultralytics released its open source implementation of YOLOv5 repo on GitHub [https://github.com/ultralytics/yolov5], which supposedly said to be the state of the art among all known YOLO implementations according to the Ultralytics GitHub page.

Image for post

Based on their results is shows how well it outperformed EfficientDet which is Googles open source object detection framework, but what I find strange is that while they do not explicitly show their comparison with YOLOv4, YOLOv5 is said to be able to achieve fast detection at 140FPS running on a Tesla P100 in comparison to YOLOv4 which bench-marked at a measly 50 FPS stated on an article published on the Roboflow blog titled YOLOv5 is Here: State-of-the-Art Object Detection at 140 FPS by Joseph Nelson and Jacob Solawetz [https://blog.roboflow.ai/yolov5-is-here/] .

Image for post

Furthermore, they mentioned that “YOLOv5 is small at only 27 Megabytes”. What, that is ridiculously small compared to the 244 megabytes of YOLOv4 with darknet architecture…Whaaat… That’s nearly 90 percent small than YOLOv4. That’s craaazzy.

In terms of accuracy, “YOLOv5 performs on par with YOLOv4.”

So essentially looking at the claims in which YOLOv5 is said to be Extremely fast,** light** in terms of its model size but** on par** in terms of accuracy with the YOLOv4 benchmark.

Just food for thought if PlayStation or Xbox released a new console that had the same graphics performance, maybe faster load times but in a smaller package would that constitute this new console as a next gen console or just a light-weight version of the current-gen console like the PS4 Slim or Xbox One S? Let me know in the comments what you think.

Part 2 — Questions

So some further questions that crossed my mind are can you claim or name a technology even opensource ones as your own even though you were not the original creator. Eeeh…Im not sure, this one is a debatable one. Does using the exact same framework and just modifying a bit give you the right to brand it as your own but with an increment in the version number, in this case YOLO with version 5. Well I guess this depends on the original creator or creators of the framework. You may or may not have heard of the original creator Joseph Redmon whom tweeted in February 2020 that he would step down from his research of his brain child YOLO due to the societal impact their work was having. He stated:

“ I loved the work but the military applications and privacy concerns eventually became impossible to ignore”.

Redmon had created 3 iterations of YOLO in partnership with Ali Faradi.

Now later this year YOLOv4 appeared in April 2020 but by none of the original authors but rather by Bochkovskiy et. al. The paper was published and peer reviewed, GitHub code uploaded to the AlexeyAB/darknet repo and everything seemed fine, the technological upgrade was great and well received in the computer vision community. So does this mean that if Bochkovskiy et. al. did it, then anyone else can take the YOLO framework, make some improvements and increment the version number? Well that’s exactly what happened.

Glenn Jocher, you know the founder and CEO of Ultralytics dropped YOLOv5 like a bomb, BOOM. So you must still be wondering… okay Ritz… tell us now… so is YOLOv5 legit or it a ruse or a lie. Okay, okay, okay I know you want the answer, but hold on a bit right, lets first examine the evidence.

#artificial-intelligence #computer-vision #deep-learning #yolov4 #yolov5 #deep learning

Lenora  Hauck

Lenora Hauck

1597682760

Write a highly efficient python Web Crawler

Write a highly efficient python Web Crawler

As my previous blog, I use the python web Crawler library to help crawl the static website. For the Scrapy, there can be customize download middle ware, which…

Mark Duan

Mark Duan

July 14, 2015

As my previous blog, I use the python web Crawler library to help crawl the static website. For the Scrapy, there can be customize download middle ware, which can deal with static content in the website like JavaScript.

However, the Scrapy already helps us with much of the underlying implementation, for example, it uses it own dispatcher and it has pipeline for dealing the parsing word after download. One drawback for using such library is hard to deal with some strange bugs occurring because they run the paralleled jobs.

For this tutorial, I want to show the structure of a simple and efficient web crawler.

First of all, we need a scheduler, who can paralleled the job. Because the most of the time is on the requesting. I use the gevent to schedule the jobs. Gevent uses the libevent as its underlying library, which combines the multithreading and event-based techniques to parallel the job.

There is the sample code:

import gevent
from gevent import Greenlet
from gevent import monkey
from selenium import webdriver
monkey.patch_socket()
class WebCrawler:
    def __init__(self,urls=[],num_worker = 1):
        self.url_queue = Queue()
        self.num_worker = num_worker
    def worker(self,pid):
        driver = self.initializeAnImegaDisabledDriver()  #initilize the webdirver
#TODO catch the exception
        while not self.url_queue.empty():
            url = self.url_queue.get()
            self.driver.get(url)
            elem = self.driver.find_elements_by_xpath("//script | //iframe | //img") ## get such element from webpage
    def run(self):
        jobs = [gevent.spawn(self.worker,i) for i in xrange(self.num_worker)]

#python #efficient python #efficient python web crawler

Ahebwe  Oscar

Ahebwe Oscar

1624067081

REST Implementation Of Django Authentication System for Python

djoser

REST implementation of Django authentication system. djoser library provides a set of Django Rest Framework views to handle basic actions such as registration, login, logout, password reset and account activation. It works with custom user model.

Instead of reusing Django code (e.g. PasswordResetForm), we reimplemented few things to fit better into Single Page App architecture.

Developed by SUNSCRAPERS with passion & patience.

Requirements

To be able to run djoser you have to meet following requirements:

  • Python (3.6, 3.7, 3.8, 3.9)
  • Django (2.2, 3.1)
  • Django REST Framework 3.11.1

If you need to support other versions, please use djoser<2.

Installation

Simply install using pip:

$ pip install djoser

And continue with the steps described at configuration guide.

#django #authentication #rest implementation of django authentication system for python #rest #django authentication system for python #rest implementation