Coder Social home page Coder Social logo

kevinmaltezcavalheiro / tracking-droplets Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 25.25 MB

This directory is dedicated to the implementation of algorithms aimed at detecting droplets in microfluidic images.

Home Page: https://gitlab.uliege.be/K.Maltez/tracking_droplets/-/tree/main?ref_type=heads

Python 100.00%
detectron2 droplet droplet-analysis droplets droplets-tracking microfluidic microfluidic-chip microfluidics

tracking-droplets's Introduction

Droplet Detection Algorithm

This project consists of two separate codes. The first one is an algorithm I developed based on conventional image analysis. The second one uses the Detectron2 deep learning algorithm from Meta group https://ai.meta.com/tools/detectron2/.

Using the first algorithm

Here are the main steps for installation and usage.

  1. Create a PyCharm environment and verify that the virtual environment folder (venv) has been created.
  2. Clone the project from GitLab using either SSH or HTTPS. For example:
cd /path/to/your/python/project/and/venv/directory/
git clone [email protected]:K.Maltez/tracking_droplets.git
  1. Open the project in PyCharm. The relevant files for this model are training_svc_blackhat.py, tracking_droplet_blackhat.py, and the svc directory.
  2. Install necessary libraries by running the following command in the PyCharm terminal (make sure to install them in the virtual environment):
pip install matplotlib numpy opencv-python time pandas scikit-image scipy scikit-learn joblib trackpy mplcursors

To use the code, follow these steps:

  1. Navigate to the files dictionary in tracking_droplet_blackhat.py. Change the path to your video file of choice. You can save multiple paths as "video1", "video2", etc., to avoid retyping it each time you change videos.
  2. In the main section, specify your video with video = "video7" (for example). This corresponds to the previously defined path.
  3. Still at the beginning of main, adjust the main parameters such as pixel size and frames per second (fps) according to your video. Also choose which images to load through the video_sampling, start_frame, and end_frame variables. Note that changing the sampling rate will also affect the fps.
  4. Run the code! The detected drops should appear in green.

For more information about how the code works and how to adapt it to your needs, see algorithm1.md. For the use of detectron2, see algorithm2.md.

As this is a first version, feel free to provide feedback regarding optimization or potential bugs. I will do my best to correct them over time.

Here is an example of droplets detections based on the first algorithm

Algorithm1

With pytrack, it is also possible to track droplets frame by frame while watching the video :

trajectory

Moreover, you can plot the histogram of different velocities measured:

histogram

And here another example is provided by using detectron2 (note that I forgot to change 'balloon' to 'droplet' following a tutorial on using detectron2 https://gilberttanner.com/blog/detectron-2-object-detection-with-pytorch/)

Algorithm2

tracking-droplets's People

Contributors

kevinmaltezcavalheiro avatar

Stargazers

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