Giter Site home page Giter Site logo

aml_assignment1's Introduction

  1. As my dataset I chose photos of energy drinks. In my dataset i have 2 classes in total.
  • Red bull (written with a typo in my notebooks)
  • Green Burn In my dataset i tried to make all the possible positions of the cans(Vertical, horizontal, reversed etc.) to make my detection model as general as possible. And in total in my final dataset I got 142 photos. As an experiment in some of the photos I didn't have any of the classes, to see, that will model do in such a case.
  1. Step two is to manually annotate all the photos in roboflow. This is one of the most tedious steps as it doesn't require any special skills, but it does take some time. After that, I could easily create a dataset with roboflow, even with already annotated photos. And after the augmentation I got 342 photos (300 in train, 26 in valid and 16 in test).
    asd and after this with the help of the roboflow lib for python, import this dataset to my notebook is simply
!pip install roboflow

from roboflow import Roboflow
rf = Roboflow(api_key="i5a31149ZXb5vXFpPtOS")
project = rf.workspace("ds-sdvyu").project("aml-ass1")
dataset = project.version(2).download("yolov8")
  1. For the detecron2 and faster RCNN I do the following steps:
  • Install the data set from Roboflow in COCO format.
  • Register COCO instances for training, test and validation data
  • Define config for the model with all required parameters.
  • Create a COCO trainer with the generated config and train the faster RCNN from the model_zoo of the detectron.
  • Check the results of the model training in the test dataset The code of the training process can be found in the file Detectron2_RCCN.ipynb or with the following colab link here
  1. For the YoloV8 model, I take the next steps:
  • Download the dataset specially prepared for the YoloV8 model using the roboflow API.
  • install the Yolo model with the ultralytics python lib
  • train Yolo on my custom dataset using the CLI command (it's just 1 line of code)
  • Check the results of the model predictions on the validation and test datasets. Notebook with the code of YoloV8 training process can be found in the file YoloV8.ipynb by the following colab link here
  1. In terms of metrics I got the following resutls: For the YoloV8: On the val data seconds

For the Faster RCNN: On the val data third

  • In terms of the MeanAveragePrecision both models got moreless the same result. So, they can be considered as equal. Both models do not works perfectly. In the test inference both models detect instance of the Green burn in the picture of cat 4 5 Model give the following results, beacuse in the training dataset is pretty small. And allmost all the training data contains one of the classes in the picture. Thats why, model tries to detect something, that is not energy drink in fact.

  • In terms of time. YoloV8 spend ~10 second to train on 1 of 25 epoch. And faster RCNN spend ~50 minuts on training with ~40 seconds per epoch (aprox. 75 epochs). So, Faster RCNN needs more epochs to converge and takes 4 time more time per epoch . 6 In the picture above we may see, that after some experements, researches get, that YOLO of the smallest size works >2 times faster then Faster R-CNN.

  • In terms of size

  • YoloV8 used 6.91GB of VRAM during the training process.
  • Faster R-CNN in my configuration uses ResNeXt-101-32x8d model (from Detectron documentation) and it uses aproximately 6.7GB of VRAM during the train. So from this we came to the conclusion that models have +- equivalent size.

aml_assignment1's People

Contributors

naryst 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.