Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ from transformers import Blip2Processor
|
|
3 |
from peft import PeftModel
|
4 |
import streamlit as st
|
5 |
from PIL import Image
|
6 |
-
import torch
|
7 |
import os
|
8 |
|
9 |
preprocess_ckp = "Salesforce/blip2-opt-2.7b" #Checkpoint path used for perprocess image
|
@@ -42,12 +42,13 @@ def main():
|
|
42 |
#init_model()
|
43 |
|
44 |
#Select few sample images for the catagory of cloths
|
45 |
-
option = st.selectbox('
|
46 |
-
|
|
|
47 |
|
48 |
if file_name is None and option is not None:
|
49 |
|
50 |
-
file_name = os.join
|
51 |
|
52 |
if file_name is not None:
|
53 |
|
|
|
3 |
from peft import PeftModel
|
4 |
import streamlit as st
|
5 |
from PIL import Image
|
6 |
+
#import torch
|
7 |
import os
|
8 |
|
9 |
preprocess_ckp = "Salesforce/blip2-opt-2.7b" #Checkpoint path used for perprocess image
|
|
|
42 |
#init_model()
|
43 |
|
44 |
#Select few sample images for the catagory of cloths
|
45 |
+
option = st.selectbox('Select from sample an images', ('cap', 'tee', 'dress'), index = -1)
|
46 |
+
st.text("OR")
|
47 |
+
file_name = st.file_uploader("Upload an image")
|
48 |
|
49 |
if file_name is None and option is not None:
|
50 |
|
51 |
+
file_name = os.path.join(sample_img_path, option)
|
52 |
|
53 |
if file_name is not None:
|
54 |
|