Instructions to use Yodazon/3DPrintFailureType with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Yodazon/3DPrintFailureType with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("image-to-text", model="Yodazon/3DPrintFailureType")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Yodazon/3DPrintFailureType", device_map="auto") - Notebooks
- Google Colab
- Kaggle
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
``` |