Coder Social home page Coder Social logo

ajithvcoder / multivideo_objectdetection_mlops_project Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 95.2 MB

Multi video offline streaming and Yolov8 object detection with Kafka, torch serve, AWS EC2

Home Page: https://www.youtube.com/playlist?list=PLaiyLZ9Xs1bzsHfMhjTSJD9Jfj2VwBXZU

License: MIT License

Python 44.59% Jupyter Notebook 46.86% Dockerfile 1.57% CSS 0.17% JavaScript 4.17% HTML 2.43% Shell 0.21%
aws-ec2 confluent-kafka mongodb onnx streaming torchserve flask flask-socketio yolov8

multivideo_objectdetection_mlops_project's Introduction

Multivideo_Objectdetection_MLOPS_Project

Youtube Playlist : Link here

Description

I am having a set of videos and kafka producer is taking and passing to kafka server then consumer consumes it. The consumer has torchserve part and then objects are detected by it and then stored in mongo db.

its offline streaming project not real time streaming. but can be made as real time streaming with modifications in producer part

Procedure

docker network create kafka-network

docker compose -f kafka/docker-compose.yml build --no-cache

docker compose -f kafka/docker-compose.yml up

docker compose -f docker-compose.yml build --no-cache

docker compose -f docker-compose.yml up

Inference at http://localhost:5000

Check if torchserve is enabled http://localhost:8081/models

To delete the containers

docker compose -f kafka/docker-compose.yml down
docker compose -f docker-compose.yml down

EC2 docker installation

sudo apt-get update -y

sudo apt-get upgrade

curl -fsSL https://get.docker.com -o get-docker.sh

sudo sh get-docker.sh

sudo usermod -aG docker ubuntu

newgrp docker

Note & Value added

if you use a better model with good dataset it can predict quality will be increased. I worked on integrating following parts in code as its a MLOPs project.

  • Confluent Kafka(base) - docker and python based confluent kafka (i didnt use other features of confluent kafka)

  • TorchServe(Onnx)

  • Flask

  • Flask socketio

  • From data ingestion to evaluation stage

  • dvc pipeline

  • docker-compose

  • Mongodb

  • AWS EC2

  • Kindly change the epochs in params.yaml file to 60 and then replace "trained_model_60epoch.onnx" with "detection.onnx" in Dockerfile for using the model training with dvc repro. I dont have a gpu so i trained in colab and placed "trained_model_60epoch.onnx" file in git already.

  • Kafka part can also be improved

  • In comming days i will try to create and explain part by part example how kafka producer and consumer commincates, how torchserve serves, etc in detail

Github CI/CD

  • it seems that docker compose with github CI/CD is not possible but you can always create more docker containers with this type of CI/CD pipeline feel free to explore it

References

  1. https://github.com/wingedrasengan927/Distributed-Multi-Video-Streaming-and-Processing-with-Kafka/tree/master

multivideo_objectdetection_mlops_project's People

Contributors

ajithvcoder avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

shashipal95

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.