Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +2 -2
src/streamlit_app.py
CHANGED
|
@@ -5,7 +5,7 @@ import numpy as np
|
|
| 5 |
import tempfile
|
| 6 |
import torch
|
| 7 |
import matplotlib.pyplot as plt
|
| 8 |
-
from transformers import
|
| 9 |
from PIL import Image, ImageDraw
|
| 10 |
|
| 11 |
# Fix cache permission issue
|
|
@@ -15,7 +15,7 @@ model_id = "NaveenKumar5/Solar_panel_fault_detection"
|
|
| 15 |
|
| 16 |
@st.cache_resource
|
| 17 |
def load_model():
|
| 18 |
-
extractor =
|
| 19 |
model = AutoModelForObjectDetection.from_pretrained(model_id)
|
| 20 |
return extractor, model
|
| 21 |
|
|
|
|
| 5 |
import tempfile
|
| 6 |
import torch
|
| 7 |
import matplotlib.pyplot as plt
|
| 8 |
+
from transformers import AutoImageProcessor
|
| 9 |
from PIL import Image, ImageDraw
|
| 10 |
|
| 11 |
# Fix cache permission issue
|
|
|
|
| 15 |
|
| 16 |
@st.cache_resource
|
| 17 |
def load_model():
|
| 18 |
+
extractor = AutoImageProcessor.from_pretrained(model_id)
|
| 19 |
model = AutoModelForObjectDetection.from_pretrained(model_id)
|
| 20 |
return extractor, model
|
| 21 |
|