Metadata-Version: 2.4
Name: ParticleAnalyzer
Version: 1.4.1
Summary: SEM Image Analysis Tool
Author-email: Kirill Rybakov <rybakov-ks@ya.ru>
Maintainer-email: Kirill Rybakov <rybakov-ks@ya.ru>
License: GPL-3.0
Project-URL: Homepage, https://github.com/rybakov-ks/ParticleAnalyzer
Project-URL: Documentation, https://github.com/rybakov-ks/ParticleAnalyzer#readme
Project-URL: Repository, https://github.com/rybakov-ks/ParticleAnalyzer.git
Project-URL: Bug Tracker, https://github.com/rybakov-ks/ParticleAnalyzer/issues
Project-URL: Live Demo, https://particleanalyzer.ru
Project-URL: Telegram Bot, https://t.me/particleanalyzer_bot
Keywords: SEM,microscopy,image-analysis,particle-analysis,materials-science,nanoparticles,computer-vision,opencv,python,scientific-computing,microstructure,particle-size,image-processing,detectron2,YOLO,deep-learning,microscope-images,material-characterization,automated-measurements,research-tools
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: gradio==5.50.0
Requires-Dist: gradio_imagemeasurement
Requires-Dist: gradio-rangeslider
Requires-Dist: matplotlib
Requires-Dist: opencv-python
Requires-Dist: opencv-python-headless
Requires-Dist: Pillow
Requires-Dist: plotly
Requires-Dist: sahi
Requires-Dist: scipy
Requires-Dist: tqdm
Requires-Dist: ultralytics>=8.4.7
Requires-Dist: huggingface_hub
Requires-Dist: openai
Requires-Dist: Requests
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: supervision
Requires-Dist: easyocr
Requires-Dist: onnxruntime
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: flake8>=6.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: pre-commit>=3.0.0; extra == "dev"
Requires-Dist: isort>=5.12.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx>=6.0.0; extra == "docs"
Requires-Dist: sphinx-rtd-theme>=1.2.0; extra == "docs"
Requires-Dist: myst-parser>=1.0.0; extra == "docs"
Dynamic: license-file

# ParticleAnalyzer

[![LIVE Application](https://img.shields.io/badge/LIVE-Application%20at%20particleanalyzer.ru-brightgreen)](https://particleanalyzer.ru/)
[![Slow Demo?](https://img.shields.io/badge/Telegram-Try%20Mini%20App-blue)](https://t.me/particleanalyzer_bot)
[![PyPI Version](https://img.shields.io/pypi/v/particleanalyzer?label=PyPI)](https://pypi.org/project/particleanalyzer/)
[![Monthly Downloads](https://static.pepy.tech/badge/particleanalyzer/month)](https://pepy.tech/project/particleanalyzer)


<div align="left">
  <a href="https://sem.rybakov-k.ru/">
    <img src="https://raw.githubusercontent.com/rybakov-ks/ParticleAnalyzer/refs/heads/main/Images/Logo.png" alt="ParticleAnalyzer Logo" width="300"/>
  </a>
</div>

**ParticleAnalyzer** Is A Computer Vision-Based Tool for Automatic Segmentation and Size Analysis of Nanoparticles in Scanning Electron Microscope (SEM) and Transmission Electron Microscope (TEM) Images.

---

## 🎬 Demonstration

<p align="center">
  <strong>Video demonstrations:</strong><br>
  <a href="https://github.com/rybakov-ks/ParticleAnalyzer/blob/main/Images/ParticleAnalyzer.mp4">▶️ Local video (MP4)</a> | 
  <a href="https://youtu.be/qlCuZDjDyqk">▶️ YouTube demonstration</a>
</p>

<p align="center">
  <img src="https://raw.githubusercontent.com/rybakov-ks/ParticleAnalyzer/main/Images/example.gif" alt="Example" width="600">
</p>

---

## 🛠 Installation Guide

 ### 1. 📥 Install PyTorch with CUDA support
Make sure your system has an NVIDIA GPU with CUDA. Install [PyTorch](https://pytorch.org/get-started/locally/) using the appropriate CUDA version (e.g., CUDA 11.8):
   ```python
   pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
   ```
If you do not have a CUDA-capable GPU, use the CPU version instead—however, in this case, ParticleAnalyzer will run significantly slower:
   ```python
   pip install torch torchvision torchaudio
   ```
### 🧪 2. Install Detectron2 (Optional)

If you want to enable advanced instance segmentation, install Detectron2:
```python
pip install 'git+https://github.com/facebookresearch/detectron2.git'
```
> [!WARNING]
> *There may be problems installing Detectron2. Use the official [documentation](https://detectron2.readthedocs.io/en/latest/tutorials/install.html).*
### 📦 3. Install ParticleAnalyzer
Finally, install ParticleAnalyzer from PyPI:
```python
pip install --upgrade ParticleAnalyzer
```
✅ Now you're ready to run the application:
```python
ParticleAnalyzer run
```
Open in browser: http://127.0.0.1:8000 

You can specify the port if necessary:
```python
ParticleAnalyzer run --port 5000
```

Launch with LLM support ([OpenRouter](https://openrouter.ai/settings/keys) or [Hugging Face](https://huggingface.co/settings/tokens) API key required):
```python
ParticleAnalyzer run --port 5000 --api-key YOUR_OPENROUTER_API_KEY
```
