Update app.py
Browse files
app.py
CHANGED
|
@@ -166,15 +166,13 @@ def process_image(image_path, prompt):
|
|
| 166 |
#shutil.copy(temp_image_path, target_image_path)
|
| 167 |
|
| 168 |
# Convert image to base64
|
| 169 |
-
|
| 170 |
-
with open("/home/user/app/data/history/bbb_1.png", "rb") as image_file:
|
| 171 |
encoded_string = b64encode(image_file.read()).decode()
|
| 172 |
-
|
| 173 |
-
print(encoded_string)
|
| 174 |
|
| 175 |
# Prepare the data for the API request (specific to the API you're using)
|
| 176 |
data = {
|
| 177 |
-
'image':
|
| 178 |
'input': prompt,
|
| 179 |
}
|
| 180 |
return data
|
|
|
|
| 166 |
#shutil.copy(temp_image_path, target_image_path)
|
| 167 |
|
| 168 |
# Convert image to base64
|
| 169 |
+
with open(image_path, "rb") as image_file:
|
|
|
|
| 170 |
encoded_string = b64encode(image_file.read()).decode()
|
| 171 |
+
|
|
|
|
| 172 |
|
| 173 |
# Prepare the data for the API request (specific to the API you're using)
|
| 174 |
data = {
|
| 175 |
+
'image': encoded_string,
|
| 176 |
'input': prompt,
|
| 177 |
}
|
| 178 |
return data
|