Coder Social home page Coder Social logo

hypraptive / bearid Goto Github PK

View Code? Open in Web Editor NEW
47.0 7.0 6.0 40.24 MB

Hypraptive BearID project. FaceNet for bears.

Home Page: https://hypraptive.github.io/

License: MIT License

CMake 0.37% C++ 26.67% Python 64.29% Dockerfile 0.47% XSLT 0.89% Shell 7.31%
deep-neural-networks deep-learning machine-learning face-recognition wildlife computer-vision bears

bearid's Introduction

The repository is forked and further updated/maintained here: [https://github.com/bearid/bearid-dlib]

bearid

BearID Project code repository. For more information, read the hypraptive blog.

Pre-Requisites

  • dlib (tested with version 19.16) - download and install somewhere. You should have OpenCV and CUDA and other packages which are helpful for dlib.
  • boost (tested with version 1.58.0)

Build

Uses cmake flow:

git clone https://github.com/hypraptive/bearid.git
cd bearid
mkdir build
cd build
cmake -DDLIB_PATH=<path_to_dlib> ..
cmake --build . --config Release

Run

How to run end-to-end inferencing using bearid.py or each of it's components individually.

Running bearid

Use the bearid.py python 3 script to predict the bear identities from a set of images.

The bearid.py script expects all of the binaries and networks to be in the same directory as the script. If, for example, you cloned and built bearid as ~/bearid and cloned the models as ~/bearid-models, you can:

mkdir ~/tools
cp ~/bearid/bearid.py ~/tools
cp ~/bearid/build/bear* ~/tools
cp ~/bearid-models/*.dat ~/tools

Then you can run:

~/tools/bearid.py <image_file/directories>

Intermediate results and log files will be written to the current working directory. Progress messages and final results are printed to standard out.

Running each component

Use the imglab and the C++ bearid components:

  • Imglab (from dlib) - create an XML file containing all source images
    • imglab -c <source_img_file> <image files/directories>
  • Bearface - find bear faces and face landmarks
    • ./bearface --infer <bearface_network_file> <source_img_file>
  • Bearchip - align and crop bear faces and produce bear chips
    • ./bearchip [-root <img_root_dir>] <face_metadata_file>
  • Bearembed - generate a 128D embedding from bear chips
    • ./bearembed --embed <bearembed_network_file> --anet <chip_metadata_file>
  • Bearsvm - classify set of embeddings using SVM one-vs-one classifier
    • ./bearsvm --infer <bearsvm_network_file> <embed_metadata_file>

Tools

There are python tools and scripts in the tools directory for managing datasets and evaluating results.

Models

For pre-trained network files, see: bearid-models.

bearid's People

Contributors

ejmiller2 avatar nguyen-mary avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bearid's Issues

How to use bearembed --test?

I try to bearembed --test chip_folder or bearembed --test chip_folder/face_chip.xml
always get

Give a xml chip file  as input.  It should list chips and labels to be
used to learn to distinguish between these labels with metric learning.  
For example:
   ./bearembed <xml_file>

Failed build under macOS 10.14 and Xcode 10

/Users/alexgao/Dev/bearid/bearembed.cpp:335:20: error: call to 'jitter_image' is ambiguous
            crop = jitter_image(crop,rnd);
                   ^~~~~~~~~~~~
/Users/alexgao/Downloads/dlib-19.16/dlib/../dlib/array2d/../geometry/../image_processing/../image_transforms/interpolation.h:2208:16: note: candidate function [with image_type =
      dlib::matrix<dlib::rgb_pixel, 0, 0, dlib::memory_manager_stateless_kernel_1<char>, dlib::row_major_layout>]
    image_type jitter_image(
               ^
/Users/alexgao/Dev/bearid/bearembed.cpp:124:12: note: candidate function [with image_type = dlib::matrix<dlib::rgb_pixel, 0, 0, dlib::memory_manager_stateless_kernel_1<char>,
      dlib::row_major_layout>]
image_type jitter_image(
           ^
1 error generated.
make[2]: *** [CMakeFiles/bearembed.dir/bearembed.cpp.o] Error 1
make[1]: *** [CMakeFiles/bearembed.dir/all] Error 2
make: *** [all] Error 2

Any interest in integrating this with the Wildbook backend?

We're continually investing in the architecture of our IBEIS platform for Wildbook:

https://github.com/WildbookOrg/ibeis

We use this for multiple detection and ID models for multiple species. If you wrap a system as a plugin, it then allows for execution from the Wildbook front end and REST-based access.

Any interest in wrapping your work as a plugin and taking advantage of our pipeline in Wildbook?

Thanks,
Jason Holmberg
Wild Me/Wildbook
[email protected]

Failed build under macOS 10.14 and Xcode 10

Undefined symbols for architecture x86_64:
  "_USER_ERROR__missing_dlib_all_source_cpp_file__OR__inconsistent_use_of_DEBUG_or_ENABLE_ASSERTS_preprocessor_directives_", referenced from:
      __GLOBAL__sub_I_bearsvm.cpp in bearsvm.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bearsvm] Error 1
make[1]: *** [CMakeFiles/bearsvm.dir/all] Error 2
make: *** [all] Error 2

Clean up comments

Clean up comments for all the cpp files.

  • Remove example code comments
  • Explain what's going on
  • Reference examples

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.