Giter Site home page Giter Site logo

personreid's Introduction

Adaptive Cross-Camera Video Analytics at the Edge: A Mean-Field Game Approach

Prerequisites

  • Python 3.6
  • GPU Memory >= 6G
  • Numpy
  • Pytorch 0.3+
  • timm pip install timm for Swin-Transformer with Pytorch >1.7.0
  • pretrainedmodels via pip install pretrainedmodels
  • [Optional] apex (for float16)
  • [Optional] pretrainedmodels

Getting started

Installation

Dataset & Preparation

Download Market1501 Dataset [Google] [Baidu]

Preparation: Put the images with the same id in one folder. You may use

python prepare.py

Remember to change the dataset path to your own path.

Train ReID Network

Adapting the method from Person_reID_baseline_pytorch. We train a model by

python train.py --gpu_ids 0 --name ft_ResNet50 --train_all --batchsize 32  --data_dir your_data_path

--gpu_ids which gpu to run.

--name the name of model.

--data_dir the path of the training data.

--train_all using all images to train.

--batchsize batch size.

--erasing_p random erasing probability.

Train a model with random erasing by

python train.py --gpu_ids 0 --name ft_ResNet50 --train_all --batchsize 32  --data_dir your_data_path --erasing_p 0.5

Generate correlation

In test.py, extract_feature() helps to generate the feature representations, and spatial_temporal_distribution() function is used to generate the spatial and temporal correlation.

Mean-Field Game

The code to solve the MFG will not be published for now.

Test

To track query objects, run

python mfg.py --reid_method nn --split 32 --spatial 0.1 --temporal 0.1 

--split is the stepsize for your MFG.

--spatial is the threshold for spatial correlation filtering.

--temporal is the threshold for temporal correlation filtering.

Results

Extensive experiments on a six-camera dataset demonstrate that, with the help of our dynamic correlation models, the overall workload can be reduced by 36% in general. For queries with a large search space, the tracking cost can be reduced by 40$\times$ with 6% precision improvement.

截屏2022-03-03 下午11.48.25

截屏2022-03-03 下午11.48.49

截屏2022-03-03 下午11.49.03

Demonstration

All results drawing functions are in utils.py.

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.