Giter Site home page Giter Site logo

grainsight's Introduction

GrainSight: README

GrainSight is a user-friendly application designed for petrographers and microscopists to perform real-time grain segmentation and analysis on microscopic thin section images. Built on top of the powerful FastSAM segmentation model, GrainSight allows you to extract quantitative data and insights from your images, aiding in various petrographic studies.

Importance in Petrographic Studies:

  • Automated Grain Segmentation: GrainSight eliminates the need for manual grain boundary tracing, saving significant time and effort.
  • Quantitative Analysis: Extract object-specific parameters such as area, perimeter, roundness, aspect ratio, and longest length, enabling quantitative analysis of grain characteristics.
  • Mineral Identification and Classification: The extracted parameters can assist in mineral identification and classification based on their morphological properties.
  • Textural Analysis: Grain size distribution and spatial arrangement of grains can be studied to understand the depositional and diagenetic history of rocks.

Installation and Usage:

1. Create a Virtual Environment (Recommended):

It's recommended to use a virtual environment to manage project-specific dependencies. You can create one using venv or conda:

# Using venv
python3 -m venv grainsight_env

# Using conda
conda create -n grainsight_env python=3.8  # Replace 3.8 with your desired Python version

2. Activate the Virtual Environment:

# For venv
source grainsight_env/bin/activate  # On Linux/macOS
grainsight_env\Scripts\activate  # On Windows

# For conda
conda activate grainsight_env

3. Clone the GrainSight Repository:

git clone https://github.com/fazzam12345/grainsight.git

4. Install Requirements:

Install the required libraries from the requirements.txt file:

pip install -r requirements.txt

5. Run the Application:

Start the Streamlit application:

streamlit run app.py

This will open the GrainSight application in your web browser.

Usage:

  • Upload an Image: Select a microscopic thin section image in JPG, PNG, or JPEG format.
  • Set Parameters (Optional): Adjust segmentation parameters like input size, IOU threshold, and confidence threshold as needed.
  • Draw a Line for Scale: Draw a line on the image and enter its real-world length (in micrometers) to set the scale for measurements.
  • Run Segmentation: Click the "Run Segmentation" button to segment the image and extract grain parameters.
  • Analyze Results: View the segmented image and the table of calculated grain parameters. You can also download the data as a CSV file.
  • Visualize Distributions: Select a parameter to plot its distribution and gain further insights into grain characteristics.

Additional Notes:

  • Dependencies: Make sure you have the required versions of Python, PyTorch, Torchvision, and other libraries installed. Refer to the requirements.txt file for details.
  • GPU Acceleration: For faster processing, you can use a CUDA-enabled GPU with the appropriate drivers and PyTorch version.
  • Customization: The code is modular and can be easily extended or customized to suit your specific needs.

grainsight's People

Contributors

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