PrintWatch uses Artificial Intelligence to monitor your 3D prints for any defects that begin to form. The plugin takes the video feed from any camera and runs it through a Machine Learning model that detects print defects in real-time. This repository is for custom integrations of the API, if you are using OctoPrint, refer to the OctoPrint-PrintWatch repository
Begin by cloning the repository
git clone https://github.com/printpal-io/PrintWatch.git
Enter the working directory
cd PrintWatch
Install dependencies
pip install -r requirements.txt
Create a file and import the printwatch object
from printwatch.client import PrintWatch
# Create Client object
client = PrintWatch("INSERT_API_KEY")
# Main control loop
# on a single image/new image has to be loaded every time
while True:
# Send the API request
response = client.infer('img.jpg')
print(response)
'''
# Insert custom post-processing logic here
# A base template will be added to this toolbox shortly
'''
# Wait 10.0 seconds
sleep(10.0)
The examples folder contains boilerplate code for a few common use cases and can found in examples. It includes code for:
- Defect detection on image files
- Defect detection on a webcam (HTTP) stream
- Asynchronous defect detection on a webcam (HTTP) stream
- Integrating defect detection into your server or cloud system