File size: 1,232 Bytes
ea94aba
 
38d7ffc
 
 
ea94aba
e023a86
38d7ffc
e023a86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110bde7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38d7ffc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
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
```