|
--- |
|
license: mit |
|
language: |
|
- en |
|
pipeline_tag: image-to-text |
|
--- |
|
This model is to help determine the type of problem a 3D print has. |
|
The model uses AlexNet CNN Architecture built using PyTorch |
|
|
|
The model trained on images of 3D prints as they are printing as well as post printing. |
|
Training set of images is about ~5GB |
|
|
|
Current version has 4 outputs: |
|
1. Good |
|
2. Spaghetti |
|
3. Stringing |
|
4. Overextrusion |
|
|
|
Of its current iteration, the Model can not determine during an inference if the input is an actual 3D Print or Not. |
|
|
|
Future updates will include |
|
- Determine if the image is a 3D print or not |
|
- Determine if the image is during printing or once complete |
|
|
|
|
|
To make an inference |
|
|
|
Classes |
|
``` |
|
class_names = {0: 'good', 1: 'spaghetti', 2: 'stringing', 3: 'underextrusion'} |
|
``` |
|
|
|
Pre-Process the image using the following python function |
|
``` |
|
def preProcess(image): |
|
# Open the image from raw bytes |
|
image = Image.open(BytesIO(image)).convert('RGB') |
|
|
|
transform = transforms.Compose([ |
|
transforms.Resize(227), |
|
transforms.CenterCrop(227), |
|
transforms.ToTensor(), |
|
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)) |
|
]) |
|
|
|
input_image = transform(image).unsqueeze(0) |
|
return input_image |
|
``` |