ElBeh commited on
Commit
c925413
·
verified ·
1 Parent(s): 5429efa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -1,8 +1,14 @@
1
  import streamlit as st
2
- from transformers import pipeline
3
  from PIL import Image
4
 
5
- pipeline = pipeline(task="image-classification", model="ElBeh/ma_basemodel")
 
 
 
 
 
 
 
6
 
7
  st.title("Fake Detection")
8
 
@@ -13,7 +19,7 @@ if file_name is not None:
13
 
14
  image = Image.open(file_name)
15
  col1.image(image, use_column_width=True)
16
- predictions = pipeline(image)
17
 
18
  col2.header("Probabilities")
19
  for p in predictions:
 
1
  import streamlit as st
 
2
  from PIL import Image
3
 
4
+ # Available backend options are: "jax", "tensorflow", "torch".
5
+ import os
6
+ os.environ["KERAS_BACKEND"] = "tensorflow"
7
+
8
+ import keras
9
+
10
+ model = keras.saving.load_model("hf://ElBeh/ma_basemodel")
11
+
12
 
13
  st.title("Fake Detection")
14
 
 
19
 
20
  image = Image.open(file_name)
21
  col1.image(image, use_column_width=True)
22
+ predictions = model.predict(image)
23
 
24
  col2.header("Probabilities")
25
  for p in predictions: