Silicrop
A PyQt5-based application for silicon wafer image processing, featuring AI-powered ellipse detection and correction.
Overview
Silicrop is designed to process images of silicon wafers by:
- Detecting wafer boundaries using deep learning (DeepLabV3 segmentation)
- Fitting ellipses to wafer contours
- Correcting perspective distortion to produce circular images
- Detecting and handling "meplat" (flat edge) regions on 150mm wafers
- Supporting batch processing for multiple images
Features
- AI-Powered Detection: Uses a DeepLabV3 model with ResNet-18 backbone for wafer segmentation
- Interactive GUI: PyQt5 interface with drag-and-drop image loading
- Manual Adjustment: Click to add/move/remove ellipse fitting points
- Notch Detection: Mark notch regions with 3-point triangles (press 'N' to toggle mode)
- Batch Processing: Process multiple images in parallel
- Mask Export: Save segmentation masks for training data
Installation
Requirements
- Python 3.8+
- PyQt5
- PyTorch
- OpenCV (cv2)
- NumPy
- Pillow
- segmentation-models-pytorch
- matplotlib
- scipy
- joblib
- psutil
Install
pip install -e .
Or install dependencies directly:
pip install PyQt5 torch torchvision opencv-python numpy pillow segmentation-models-pytorch matplotlib scipy joblib psutil
Usage
Launch the Application
python -m silicrop.main
Or if installed:
silicrop
Basic Workflow
- Select a Model: Click "Select a model" to load a trained
.pthmodel file - Load Images: Drag and drop images into the left panel
- Select Scale Mode: Choose "<=150" for wafers with flat edges, ">200" for full circular wafers
- Process:
- Single image: Select image and click "Run AI"
- Batch: Click "Select All" then "Run AI (batch)"
- Save Results: Use "Save Image" or "Save Mask" buttons
Keyboard Shortcuts
- N: Toggle notch drawing mode (for marking notch regions)
- Ctrl + Drag: Pan the image view
- Scroll: Zoom in/out
Project Structure
silicrop/
├── __init__.py # Package version
├── main.py # Application entry point
├── assets/
│ └── icon.png # Application icon
├── layout/
│ ├── components.py # Main GUI (ImageProcessorApp)
│ ├── dragdrop.py # File drop list widget
│ ├── how_to.py # Help popup
│ ├── styles.py # UI stylesheets
│ └── theme.py # Application theme
└── processing/
├── crop.py # Ellipse fitting (FitAndCrop)
├── meplat.py # Flat edge detection
├── prediction.py # AI model (EllipsePredictor)
├── prediction_batch.py # Batch processing
├── rotate.py # Image rotation (Rotate)
└── utils.py # Mouse navigation handler
Key Classes
ImageProcessorApp
Main application window containing:
- File list with drag-and-drop
- Original image viewer (FitAndCrop widget)
- Processed image viewer (Rotate widget)
- Control buttons for processing and saving
EllipsePredictor
AI inference engine that:
- Loads DeepLabV3 segmentation model
- Predicts wafer masks from images
- Extracts contours and fits ellipses
- Handles meplat detection for 150mm wafers
FitAndCrop
Interactive widget for:
- Displaying original images
- Manual 5-point ellipse fitting
- Notch region marking (3 points)
- Perspective transformation to circular output
Rotate
Widget for:
- Displaying processed (circular) images
- Interactive rotation by clicking
- Line-based rotation (150mm mode)
- Point-to-bottom rotation (200mm mode)
Model Training
The application expects a trained DeepLabV3 model. Training code is available in training/model.py (not used at runtime).
Model Architecture
- Encoder: ResNet-18 (pretrained on ImageNet)
- Decoder: DeepLabV3
- Output: Binary segmentation mask
Metadata
Release files for Silicrop 1.0.18
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| silicrop-1.0.18.tar.gz | 59.4 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| silicrop-1.0.18-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 118.9 MB
Release files / silicrop-1.0.18.tar.gz
| Download URL | silicrop-1.0.18.tar.gz |
|---|---|
| Size | 59.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a2817517dda59f26ec659ff3d599e08936db0bda6df474340e0586bb086514eb
|
|
BLAKE2b-256 checksum How to use checksums |
e5d5251e4023d8926810a1abc77c85f592b7f9c9ed2adcb520b27925d16abad5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.3
|
Release files / silicrop-1.0.18-py3-none-any.whl
| Download URL | silicrop-1.0.18-py3-none-any.whl |
|---|---|
| Size | 59.4 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1d8c8e44f27045dc44f30755c5501b4370060fd6d8814daecb5a73d3426e5a82
|
|
BLAKE2b-256 checksum How to use checksums |
d5474b7621dd4939c4bd3c5dc67f52aa2a6db307736b6117cb0ed74406f878d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.3
|