tensorkelechi commited on
Commit
8e7b01a
1 Parent(s): 5161cfc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -71,14 +71,16 @@ def visualize_heatmap(model, image):
71
 
72
  # Load the pre-trained model from safeetesor file
73
  def load_pipeline():
74
- model_id = 'tensorkelechi/signature_mobilenet'
75
- # model = SiameseNetwork() # model class/skeleton
 
76
 
77
  # model.load_state_dict(torch.load(model_file))
78
- model = pipeline('image-classification', model=model_id, device='cpu')
 
79
  model.eval()
80
 
81
- return model
82
 
83
  # Streamlit app UI template
84
  st.title("Signature Forgery Detection")
 
71
 
72
  # Load the pre-trained model from safeetesor file
73
  def load_pipeline():
74
+ model_file = 'best_signature_mobilenet.safetensors' #config.safetensor_file
75
+ # model_id = 'tensorkelechi/signature_mobilenet'
76
+ model = SiameseNetwork() # model class/skeleton
77
 
78
  # model.load_state_dict(torch.load(model_file))
79
+ model = load_model(model, model_file)
80
+ # model = pipeline('image-classification', model=model_id, device='cpu')
81
  model.eval()
82
 
83
+ return model.to('cpu')
84
 
85
  # Streamlit app UI template
86
  st.title("Signature Forgery Detection")