Skip to content

A PyTorch-based crowd counting model demonstrating deployment on Flask, FastAPI, and Express.js backends, with ONNX conversion for mobile and cross-platform use.

License

Notifications You must be signed in to change notification settings

FarrelAD/PyTorch-Crowd-Counting-Model-Deployment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyTorch Crowd Counting Model Deployment

This project demonstrates a crowd counting model built with PyTorch and deployed using various frameworks such as Flask, FastAPI, Express.js, and others.
For non-Python-based frameworks like Express.js or deployment on mobile devices, the model needs to be converted into a cross-platform format.
One common approach is to use the Open Neural Network Exchange (ONNX) format.


How to Convert a PyTorch Model to ONNX

  1. Use your existing PyTorch model architecture (usually implemented as a class).
  2. Load the trained PyTorch model weights (typically saved as a .pth file).
  3. Export the PyTorch model to ONNX using torch.onnx.export().

For detailed instructions on converting a PyTorch model to ONNX, please refer to the folder 00-convert-to-onnx.


I aim to demonstrate how to easily integrate PyTorch-based models into various software systems.
Currently, this project includes demonstrations using backend frameworks such as Flask, FastAPI, and Express.js.
In the near future, I plan to extend these demonstrations to native or mobile device deployment as well.

About

A PyTorch-based crowd counting model demonstrating deployment on Flask, FastAPI, and Express.js backends, with ONNX conversion for mobile and cross-platform use.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published