This code sets:
- tracks person from single camera with Kalman filtering.
- estimate poses of people on that image. Detect pre-defined actions.
- re-identificate people in one scene using ResNet50 or other models supported.
Each person on images will be associated with one global unique id over multiple cameras.
The ids, actions, frame numbers, and other associated information are stored into a RDB with sqlite3.
Python
- opencv
- numpy
- pandas
- json
- filterpy
- scikit-learn
- Numba
- pytorch
JavaScript
- Node.js
- @tensorflow/tfjs-node-gpu
- @tensorflow-models/posenet
- canvas
- express
- body-parser
Note that tfjs-node-gpu
only supports CUDA compute capability>=6.0.
Currently (Apr. 2020) tfjs-node-gpu
supports CUDA=10.0, thus set up your environment with CUDA=10.0.
One of the successful build was:
- CUDA=10.0
- cuDNN=7
- pytorch=1.2
- torchvision=0.4.2
- node=12.16.2
- tensorflow-js=1.7.2
- posenet=2.2.1
Use conda/pip and npm to install these libraries.
Data association between cameras can also be done by estimating personal location on each image.
This estimation was based on calibrated look-up table (image coordinates - real coordinates), created by 3D CG model in Autodesk 3dsmax.
See BMCT/3dsmax for further description. Using both ImageNet-based models and camera calibration may lead higher accuracy.
See README in each directory for further information on the components.
node poseapi.js
The script firstly load a model from the google repositry. This will take minutes depending on a model size.
In default the script uses ResNet50 architecture with 801 input resolution and 16 output stride (maximum accuracy expected).
After you load the model, the server is ready to use API!
The server defines POST communication. Use POST to get results from this server. The server listens localhost:8000 in default. Change this if needed.
The request url is in default: http://localhost:8000/api/posedetect.
In python:
import requests
imgPath = "/path/to/the/image"
url = "http://localhost:8000/api/posedetect"
result = requests.post(url, data={"path": imgPath})
print(result.text)
After setting up the server, this app is almost ready to go.
import poseTrack
# create tracker instance
tracker = poseTrack.PoseTrack()
# set your image file format associated with scene number.
tracker.imgPath = "./img/camera001_date_scene%05d.png"
# register camera names in your system.
tracker.cameraList = ["PhysCamera001", "PhysCamera002"]
# initialize system.
tracker.initialize()
# start tracking
for i in range(0, 10):
result = tracker.poseTrack(i)
Remember to set up instance variables for your use, and initialize instance again by initialize() method.
PoseTrack.poseTrack()
will return the dictionary of {CameraName:InCameraId:globalUniqueId}. globalUniqueId is unique over multiple cameras you registered.
This implementation will be deprecated in future commit for the efficiency. Data will only be stored in the database, not in the instance.
The result is stored in the SQLite database.
posetrack's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.