Giter Club home page Giter Club logo

countx_berry's Introduction

CounTX_Berry: Specialized CounTX fork for berry and cluster guided counting

Alessandro Giustina, Fabio Poiesi

Contents

Preparation

Set Up Anaconda Environment:

The following commands will create a suitable Anaconda environment for running the CounTX training and inference procedures.

conda create --name countx-environ python=3.7
conda activate countx-environ
pip install torch==1.10.0+cu111 torchvision==0.11.0+cu111 torchaudio==0.10.0 -f https://download.pytorch.org/whl/torch_stable.html
pip install timm==0.3.2
pip install scipy
pip install imgaug
git clone [email protected]:niki-amini-naieni/CounTX.git
cd CounTX/open_clip
pip install .
  • If torchvision==0.11.0+cu111 torchaudio==0.10.0 aren't found the defaults can be downloaded.
  • This repository uses timm==0.3.2, for which a fix is needed to work with PyTorch 1.8.1+. This fix can be implemented by replacing the file timm/models/layers/helpers.py in the timm codebase with the file helpers.py provided in this repository.

Pre-Trained Weights

The model weights used in the paper can be downloaded from Google Drive link (1.3 GB). To reproduce the results in the paper, run the program after activating the Anaconda environment set up in Preparation. Make sure that the model file name refers to the model that you downloaded.

The checkpoint directory must be changed in the evaluator.py file.

Framework usage

The framework is divided in modules:

  • The main module from which everything is controlled is evaluator.py
  • the main.py file contains the main function that is called in evaluator.py in which the modules are layed out:
    • density_map_creator is the model itself which needs as inputs the model, the query, the image, the kernel size and stride and outputs the density map.
    • clustercount is the module responsible for the image postprocessing and for the counting, it takes as input the density map, the treshold and the original image and it outputs the cluster map and the number of clusters.
    • the showimagefun is the visualization function and contains all the code that is needed to display the results and to use the genralized output part.

Acknowledgements

The CounTX_Berry repository is based on the CounTX repository and uses code from the OpenCLIP repository. If you have any questions about our code implementation, please contact us at [email protected].

countx_berry's People

Contributors

ale-giustina avatar niki-amini-naieni avatar

Stargazers

 avatar  avatar

Watchers

 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.