Spaces:
Runtime error
Runtime error
ydshieh
commited on
Commit
•
f4148f7
1
Parent(s):
310a439
add post-processing
Browse files
app.py
CHANGED
@@ -29,7 +29,7 @@ sample_path = os.path.join(sample_dir, sample_name)
|
|
29 |
|
30 |
image = Image.open(sample_path)
|
31 |
show = st.image(image, use_column_width=True)
|
32 |
-
show.image(image, '\nSelected Image', use_column_width=True)
|
33 |
|
34 |
# For newline
|
35 |
st.sidebar.write('\n')
|
|
|
29 |
|
30 |
image = Image.open(sample_path)
|
31 |
show = st.image(image, use_column_width=True)
|
32 |
+
show.image(image, '\n\nSelected Image', use_column_width=True)
|
33 |
|
34 |
# For newline
|
35 |
st.sidebar.write('\n')
|
model.py
CHANGED
@@ -53,6 +53,7 @@ def predict(image):
|
|
53 |
token_ids = np.array(generation.sequences)[0]
|
54 |
caption = tokenizer.decode(token_ids)
|
55 |
caption = caption.replace('<s>', '').replace('</s>', '').replace('<pad>', '')
|
|
|
56 |
|
57 |
return caption
|
58 |
|
|
|
53 |
token_ids = np.array(generation.sequences)[0]
|
54 |
caption = tokenizer.decode(token_ids)
|
55 |
caption = caption.replace('<s>', '').replace('</s>', '').replace('<pad>', '')
|
56 |
+
caption.replace("à l'arrière-plan", '').("Une photo noire et blanche d'", '').replace("en arrière-plan", '')
|
57 |
|
58 |
return caption
|
59 |
|