Git Product home page Git Product logo

face-cluster-framework's Introduction

Face Cluster Framework (人脸聚类框架)

English Version | 中文版

Intorduction

For a large number of given face images, face feature extraction component is used to extract face features, and then face clustering model is used for face clustering and archiving.

Requirements

  • Python >= 3.6
  • sklearn
  • infomap
  • numpy
  • faiss-gpu(or faiss-cpu)
  • torch >= 1.2
  • torchvision

Datasets and Pretrain_models

download test data and pretrain model BaiduYun(passwd: trka)

Put face pictures in the file directory 'data/input_pictures/'. The format as follow:

Put the pretrain models in the file directory 'pretrain_models/'

'data_sample': all pictures in a file directory

'labeled_data_sample': this data you can evaluate the cluster result with set is_evaluate=True.

'pretrain_model': the feature extract pretraind model, you can retrain the model on your data(eg: masked face feature) with the method [hfsoftmax](https://github.com/yl-1993/hfsoftmax)

Run

python main.py

Results

The results in the file directory 'data/output_pictures' with default.

The output directory is constucted as follows:

.
├── data
|   ├── output_pictures
|   ├── ├── 0
|   |     |     └── 1.jpg
|   |     |     └── 2.jpg
|   |     |     └── 3.jpg
|   |     |     └── x.jpg
|   ├── ├── 1
|   |     |     └── 1.jpg
|   |     |     └── 2.jpg
|   |     |     └── 3.jpg
|   |     |     └── 4.jpg
|   ├── ├── ...
|   ├── ├── n
|   |     |     └── 1.jpg
|   |     |     └── 2.jpg
|   |     |     └── 3.jpg

all pictures in n file directory are the same person.

Evaluate

If you want evaluate the cluster result, you should label and organize the input pictures like the data 'labeled_data_sample' with the format as follow:

.
├── data
|   ├── input_pictures
|   ├── ├── people_0
|   |     |     └── 1.jpg
|   |     |     └── 2.jpg
|   |     |     └── 3.jpg
|   |     |     └── x.jpg
|   ├── ├── people_2
|   |     |     └── 1.jpg
|   |     |     └── 2.jpg
|   |     |     └── 3.jpg
|   |     |     └── 4.jpg
|   ├── ├── ...
|   ├── ├── people_n
|   |     |     └── 1.jpg
|   |     |     └── 2.jpg
|   |     |     └── 3.jpg

all pictures in people_n file directory are the same person.

In addition, you should set is_evaluate=True.

References

face-cluster-framework's People

Contributors

xiaoxiong74 avatar xiaopinggao 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.