https://github.com/crim-ca/visi-baleine

Source code for the automated photo-identification of blue whales

https://github.com/crim-ca/visi-baleine

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: researchgate.net
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.6%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Source code for the automated photo-identification of blue whales

Basic Info
  • Host: GitHub
  • Owner: crim-ca
  • License: mit
  • Language: Python
  • Default Branch: master
  • Size: 3.15 MB
Statistics
  • Stars: 0
  • Watchers: 3
  • Forks: 1
  • Open Issues: 0
  • Releases: 0
Created almost 3 years ago · Last pushed almost 3 years ago
Metadata Files
Readme License

README.md

Blue whale photo-identification with LoFTR <!-- omit in toc -->

Table of Contents <!-- omit in toc -->

Introduction

This repo contains the source code accompanying the paper "Automated blue whale photo-identification using local feature matching". Its purpose is to show that new local feature matching techniques such as LoFTR (or SuperGlue or HardNet or ...) can be used successfully to photo-identify blue whales (balaenoptera musculus). Good results have also been obtained for fin whales, i.e. balaenoptera physalus. The process is as follows: the image is first segmented to isolate the whale's body from the background, then a feature matcher finds correspondences between the segmented image and reference images from known whale individuals. The most likely candidate is the one with the "best" correspondences between its reference images and the image being analyzed. Since the approach is totally generic, it should be easy to adapt it to the photo-identification of other species.

Downloading the models

Two models need to be downloaded and saved in a "models" folder. The semantic segmentation model (basnetfsi.pth) can be found here: https://drive.google.com/file/d/1YVgw9AzOMEIxJfurRRu-OFasAV5IHCBN/view?usp=sharing. The LofTR matching model (outdoords.ckpt) is found here: https://drive.google.com/file/d/1uzGAVs2qws-z8d9m5n0mFwd3T9FsQy/view?usp=sharing.

Building the Docker image

In order to facilitate the use of the provided source code, a Dockerfile is provided. Building the Docker image is as follows:

shell sudo docker build .

Testing with sample images

Images of two blue whales (B271 and B275) are bundled with the source code to allow for a quick test. Once the Docker image is built, simply type: shell docker run -v $PWD:/input <docker image name> /input/query1.jpg for CPU execution or shell nvidia-docker run -v $PWD:/input <docker image name> /input/query1.jpg for GPU execution.

The output should be: Downloading: "https://github.com/DagnyT/hardnet/raw/master/pretrained/train_liberty_with_aug/checkpoint_liberty_with_aug.pth" to /home/user/.cache/torch/hub/checkpoints/checkpoint_liberty_with_aug.pth 100%|██████████| 5.10M/5.10M [00:00<00:00, 114MB/s] Downloading: "https://download.pytorch.org/models/resnet34-333f7ec4.pth" to /home/user/.cache/torch/hub/checkpoints/resnet34-333f7ec4.pth 100%|██████████| 83.3M/83.3M [00:02<00:00, 31.9MB/s]Opening dataset dset_Bm_RSD.txt 2 candidates B275:23.913230895996094 -> Most likely candidate B271:9.846597671508789

Acknowledgments

  • LoFTR: https://github.com/zju3dv/LoFTR

  • BASNet: https://github.com/xuebinqin/BASNet

The test images are provided courtesy of MICS

License

This work is released under an MIT license.

Reference

Please reference this work using the following citation.

bibtex @inproceedings{inproceedings, author = {Lalonde, Marc and Landry, David and Sears, Richard}, title = {Automated blue whale photo-identification using local feature matching}, booktitle = {Proc. CVAUI 2022}, year = {2022}, month = {August}, address = {Montreal, Canada} }

Owner

  • Name: crim-ca
  • Login: crim-ca
  • Kind: organization

GitHub Events

Total
Last Year

Dependencies

Dockerfile docker
  • anibali/pytorch 1.8.1-cuda11.1-ubuntu20.04 build
requirements.txt pypi
  • Pillow ==9.4.0
  • PyWavelets ==1.4.1
  • PyYAML ==6.0.1
  • brotlipy ==0.7.0
  • einops ==0.6.1
  • imageio ==2.31.1
  • kornia ==0.7.0
  • lazy_loader ==0.3
  • mkl-fft ==1.3
  • mkl-service ==2.4.0
  • opencv-python-headless ==4.8.0.76
  • packaging ==23.1
  • scikit-image ==0.21.0
  • scipy ==1.10.1
  • tifffile ==2023.7.10
  • torch ==2.0.1
  • torchvision ==0.15.2
  • triton ==2.0.0
  • yacs ==0.1.8
requirements_docker.txt pypi
  • Pillow ==9.4.0
  • PyWavelets ==1.4.1
  • PyYAML ==6.0.1
  • brotlipy ==0.7.0
  • einops ==0.6.1
  • imageio ==2.31.1
  • kornia ==0.6.0
  • lazy_loader ==0.3
  • mkl-fft ==1.3
  • mkl-service ==2.4.0
  • opencv-python-headless ==4.8.0.76
  • packaging ==23.1
  • scikit-image ==0.21.0
  • scipy ==1.10.1
  • tifffile ==2023.7.10
  • triton ==2.0.0
  • yacs ==0.1.8