NaveenKumar5 commited on
Commit
91d1c91
·
verified ·
1 Parent(s): 21368e0

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. 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 AutoFeatureExtractor, AutoModelForObjectDetection
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 = AutoFeatureExtractor.from_pretrained(model_id)
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