Skip to content

AI-powered vision system that analyzes metal substrates and determines optimal clamp positions for 3D printing, preventing deformation and ensuring print quality.

License

Notifications You must be signed in to change notification settings

asadkhalid-softdev/MetalGripAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Optimal Clamp Position Generator for Metal 3D Printing

Overview

This project addresses a common challenge in metal 3D printing: substrate deformation. When a metal substrate is placed on a perforated table for 3D printing, improper clamping can lead to deformation during the printing process, resulting in poor-quality prints.

Using computer vision and deep learning (DeepLabv3+), this solution:

  1. Analyzes top-down images of placed substrates
  2. Identifies the optimal positions for placing clamps
  3. Provides these recommendations through a simple API

Problem Statement

In metal 3D printing, workers place a metal substrate on a perforated table and secure it with clamps. If not properly clamped, the substrate can deform during printing, causing defects in the final product. Manual clamp placement is often inconsistent and depends on worker experience.

Solution

Our two-stage approach:

  1. Substrate Detection: Using DeepLabv3+ to create a pixel-perfect mask of the substrate
  2. Optimal Clamp Positioning: Analyzing the substrate mask to determine ideal positions for clamps, considering:
    • Even distribution around the substrate
    • Proximity to available perforation holes
    • Adequate support for areas prone to deformation

Project Structure

├── api/                # FastAPI implementation
│   ├── main.py         # API endpoints
│   ├── models.py       # Pydantic models
│   └── utils.py        # API utility functions
├── models/             # Deep learning model definitions
│   ├── deeplabv3plus.py        # DeepLabv3+ architecture
│   ├── substrate_model.py      # Substrate detection model
│   └── clamp_model.py          # Clamp position model
├── pipeline/           # Processing pipeline
│   ├── combined.py     # End-to-end pipeline
│   ├── preprocessing.py # Image preprocessing
│   └── postprocessing.py # Results processing
├── utils/              # Utility functions
│   └── visualization.py # Visualization tools
├── examples/           # Example images and results
│   ├── input/          # Example input images
│   └── output/         # Example output visualizations
├── requirements.txt    # Project dependencies
└── setup.py            # Package setup script

Technology Stack

  • Python 3.10+
  • TensorFlow/Keras for deep learning models
  • OpenCV for image processing
  • FastAPI for API implementation
  • NumPy for numerical operations

Setup and Installation

Prerequisites

  • Python 3.10+
  • pip/uv package manager

Installation

# Clone the repository
git clone https://github.com/yourusername/3d-print-clamp-optimizer.git
cd 3d-print-clamp-optimizer

# Create and activate virtual environment
uv venv --python 3.10
source .venv/bin/activate  # On Windows: .venv\\Scripts\\activate

# Install dependencies
pip install -r requirements.txt

Usage

Running the API locally

python -m api.main

The API will be available at http://localhost:8000

API Endpoints

  • POST /analyze: Submit an image for analysis
  • GET /result/{job_id}: Get analysis results

Example with curl

# Submit an image for analysis
curl -X POST "http://localhost:8000/analyze" \
  -F "image=@./examples/input/sample1.jpg"

# Response:
# {"job_id": "abcd1234", "status": "processing"}

# Get results
curl -X GET "http://localhost:8000/result/abcd1234"

# Response:
# {"status": "completed", "clamp_positions": [{"x": 10.5, "y": 15.2}, ...]}

License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer

This is a simplified version of a proprietary system. Dummy data and simplified models are used for demonstration purposes.

About

AI-powered vision system that analyzes metal substrates and determines optimal clamp positions for 3D printing, preventing deformation and ensuring print quality.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages