Coder Social home page Coder Social logo

lahirumesh / ssl_vision_pipeline Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 0.0 813 KB

Semi-Supervised | Pseudo Labeling pipeline with one-stage object detection models

Python 80.86% Makefile 0.53% Cuda 0.77% C++ 17.84%
object-detection yolo deep-learning yolov4 pseudolabelling semi-supervised-learning pytorch yolov3

ssl_vision_pipeline's Introduction

Semi-Supervised Pseudo Labeling with Object Detection Models

  • Images Capturing Pipeline

    • Images Capture with Augmentaion image_capture/capture_images.py
      cap = Image_Capture(0) #camera device id
      
      '''
      args : 
              img_size : Capture image size (i.e 608x608)
              img_dir : Image Folder
              rotate90 : rotate image by 90 degree angle
              rotate180 : rotate image by 180 degree angle
              rotate270 : rotate image by 270 degree angle
              scale : Scale the image
              scale_val : Scale value of the image
      '''
      cap.capture_image(img_size, 
                        img_dir,
                        rotate90=True,rotate180=True,rotate270=True,
                        scale=True,scale_val=0.2)
      
  • Data Augmentaion Pipeline for Object Detection

Pytorch YOLO models Train

  • Data Prepare

    • annotation file should be in vott csv format
    image xmin ymin xmax ymax label
    image1.jpg 50 150 288 328 label1
    image1.jpg 300 263 410 333 label2
    image2.jpg 88 63 110 223 label1
    image3.jpg 22 190 150 250 label3
    • Data Folder - >

      •   image1.jpg 
          image2.jpg
          image3.jpg
          annotation.csv
        
  • Use the train_models.py script to train YOLOv3 and YOLOv4 models

  • Training arguments for the model training.

    • --model : object detection model, i.e. YOLOv4 or YOLOv3

    • --data_dir : Image folder which contains images and the csv file

    • --weights : pre-trained weights path

    • --validation : validation data split

    • --epochs : number of training epochs

    • --batch_size : train and validation batch size

    • --image_size : train and test image size (should be multiply by 32 i.e (416,416),(512,512) or (608,608) )

    • --learning_rate: learning rate

    • --device : cuda device, i.e. 0 or 0,1,2,3 or cpu

Pytorch model Inference with Pseudo Labeling

  • Use the pseudo_label.py script to for the pseudo labeling

  • Inference arguments for the pseudo labeling.

    • --checkpoint : saved checkpoint weight file path

    • --class_file : class file which contains class names i.e class.names

    • --dir_name : folder path which contians unlabeld images

    • --conf_thresh : confident threshold value

    • --iou_thresh : IOU threshold value

    • --image_size : test image size (should be multiply by 32 i.e (416,416),(512,512) or (608,608) )

Reference:

@article{yolov3,
  title={YOLOv3: An Incremental Improvement},
  author={Redmon, Joseph and Farhadi, Ali},
  journal = {arXiv},
  year={2018}
}

@article{yolov4,
  title={YOLOv4: YOLOv4: Optimal Speed and Accuracy of Object Detection},
  author={Alexey Bochkovskiy, Chien-Yao Wang, Hong-Yuan Mark Liao},
  journal = {arXiv},
  year={2020}
}

ssl_vision_pipeline's People

Contributors

lahirumesh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ssl_vision_pipeline's Issues

Missing checkpoint weights and logs in the data_models dir

Thanks for the repository. I am missing the checkpoint weights and logs in the data_models. Also it could not get anything on Wandb.

The data_models dir structure after training:

data_models/
  |--process_data/
       |--image00.jpg
       |--annotations-export.csv
  |--class.names
  |--data_file_out.txt
  |--train.txt
  |--val.txt

There are no errors as such.
Thanks

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.