Spaces:
Sleeping
Sleeping
nazlicanto
commited on
Commit
•
09d042e
1
Parent(s):
6e3cb6a
Update app06.py
Browse files
app06.py
CHANGED
@@ -1,17 +1,15 @@
|
|
1 |
import streamlit as st
|
2 |
-
from transformers import SegformerForSemanticSegmentation, SegformerImageProcessor
|
3 |
from PIL import Image
|
4 |
import numpy as np
|
5 |
import torch
|
6 |
-
import os
|
7 |
|
8 |
-
|
9 |
-
|
10 |
|
11 |
-
model
|
12 |
-
model.
|
13 |
-
|
14 |
-
preprocessor = SegformerImageProcessor.from_pretrained(model_path, local_files_only=True)
|
15 |
|
16 |
st.title("PCB Defect Detection")
|
17 |
|
|
|
1 |
import streamlit as st
|
2 |
+
from transformers import SegformerForSemanticSegmentation, SegformerImageProcessor
|
3 |
from PIL import Image
|
4 |
import numpy as np
|
5 |
import torch
|
|
|
6 |
|
7 |
+
# Define the model path
|
8 |
+
model_hub_path = "nazlicanto/model_defectdetection"
|
9 |
|
10 |
+
# Load the model and preprocessor
|
11 |
+
model = SegformerForSemanticSegmentation.from_pretrained(model_hub_path)
|
12 |
+
preprocessor = SegformerImageProcessor.from_pretrained(model_hub_path)
|
|
|
13 |
|
14 |
st.title("PCB Defect Detection")
|
15 |
|