Giter VIP home page Giter VIP logo

trendingtechnology / play-with-torch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mheriyanto/play-with-torch

0.0 1.0 0.0 11.52 MB

:camera: Repository for playing the computer vision apps (People analytics) using PyTorch on Raspberry Pi. Tech stack: Python & Docker. Source C++: https://gitlab.com/mheriyanto/play-with-torch-dev

Home Page: https://mheriyanto.gitlab.io/play-with-torch-dev/

Python 87.93% HTML 6.57% Dockerfile 0.05% JavaScript 5.27% TeX 0.18%

play-with-torch's Introduction

Hits contributions welcome GitHub contributors GitHub last commit GitHub top language GitHub language count GitHub repo size GitHub code size in bytes LinkedIn

play-with-torch

Repository for playing the computer vision apps: People analytics on Raspberry Pi.

Tools

Tested Hardware

  • RasberryPi 4 Model B here, RAM: 4 GB and Processor 4-core @ 1.5 GHz
  • microSD Card 64 GB
  • 5M USB Retractable Clip 120 Degrees WebCam Web Wide-angle Camera Laptop U7 Mini or Raspi Camera

Tested Software

  • Ubuntu Desktop 20.10 aarch64 64 bit, install on RasberriPi 4
  • PyTorch: torch 1.6.0 aarch64 and torchvision 0.7.0 aarch64
  • Python min. ver. 3.6 (3.8 recommended)

Install the prerequisites

  • Install packages
$ sudo apt install build-essential make cmake git python3-pip libatlas-base-dev
$ sudo apt install libssl-dev
$ sudo apt install libopenblas-dev libblas-dev m4 python3-yaml
$ sudo apt install libomp-dev
  • make swap space to 2048 MB
$ free -h
$ sudo swapoff -a
$ sudo dd if=/dev/zero of=/swapfile bs=1M count=2048
$ sudo mkswap /swapfile
$ sudo swapon /swapfile
$ free -h
  • Install torch 1.6.0
$ pip3 install torch-1.6.0a0+b31f58d-cp38-cp38-linux_aarch64.whl

Folder Structure

play-with-torch/
├── config/
│    ├── config.json - holds configuration for training
│    └── parse_config.py - class to handle config file and cli options
│
├── docker/
│   ├── Dockerfile
│   └── requirements.txt
│
├── data/ - default directory for storing input data
│
├── docs/ - for documentation
│   └── play-with-torch.tex
│
├── models/ - models, losses, and metrics
│   ├── model.py
│   ├── metric.py
│   └── loss.py
│
├── samples/
│
├── saved/
│   ├── checkpoints/
│   ├── traced_model/
│   ├── models/ - trained models are saved here
│   └── logs/ - default logdir for tensorboard and logging output
│
├── site
├── templates/ - for serving model on Flask
│   └── index.html
├── tests/
├── utils/ - small utility functions
│   ├── data/
│   └── ...
│
├── inference.py - main script to inference model
├── README.md
├── trace_model.py - main script to convert model
└── train.py - main script to start training  

Usage

Run inference

$ git clone https://github.com/mheriyanto/play-with-torch.git
$ cd play-with-torch/
$ python3 inference.py video --config config/nanodet-m.yml --model saved/models/nanodet_m.ckpt --path video.mp4

Convert model

$ python3 trace_model.py --cfg_path config/nanodet-m.yml --model_path saved/models/nanodet_m.ckpt --input_shape 320,320

Training

$ python3 train.py config/nanodet_custom_xml_dataset.yml

TO DO

  • Implement Unit-Test: Test-Driven Development (TDD)

Credit to

Reference

  • NanoDet: Super fast and lightweight anchor-free object detection model. here
  • Yunjey Choi - PyTorch Tutorial for Deep Learning Researchers here
  • Victor Huang - PyTorch Template Project (here)

play-with-torch's People

Contributors

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