Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -178,12 +178,13 @@ def inference(image_url, image, min_score):
|
|
| 178 |
writer.writerow([id, data['measurement'], data['x_min'], data['x_max'], data['y_min'], data['y_max']])
|
| 179 |
# Convert the CSV content to a bytes object
|
| 180 |
|
| 181 |
-
|
| 182 |
|
| 183 |
# Upload the file to Cloudinary
|
| 184 |
upload_result = cloudinary.uploader.upload(
|
| 185 |
-
|
| 186 |
-
|
|
|
|
| 187 |
)
|
| 188 |
# return file
|
| 189 |
|
|
|
|
| 178 |
writer.writerow([id, data['measurement'], data['x_min'], data['x_max'], data['y_min'], data['y_max']])
|
| 179 |
# Convert the CSV content to a bytes object
|
| 180 |
|
| 181 |
+
csv_bytes = io.StringIO( open(filename,"r").read()).read().encode("utf-8")
|
| 182 |
|
| 183 |
# Upload the file to Cloudinary
|
| 184 |
upload_result = cloudinary.uploader.upload(
|
| 185 |
+
csv_bytes,
|
| 186 |
+
resource_type = "raw",
|
| 187 |
+
folder = "csv_files",
|
| 188 |
)
|
| 189 |
# return file
|
| 190 |
|