Skip to content

Commit af101d2

Browse files
authored
[Fix] Fixed 500 issue in /cluster_id/images API (#598)
* Converts raw data to json * reverted the brackets
1 parent 411b9c5 commit af101d2

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

backend/app/database/face_clusters.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,19 +299,20 @@ def db_get_images_by_cluster_id(
299299
bbox_json,
300300
) = row
301301

302+
import json
303+
304+
metadata_dict = json.loads(metadata) if metadata else None
302305
# Parse bbox JSON if it exists
303306
bbox = None
304307
if bbox_json:
305-
import json
306-
307308
bbox = json.loads(bbox_json)
308309

309310
images.append(
310311
{
311312
"image_id": image_id,
312313
"image_path": image_path,
313314
"thumbnail_path": thumbnail_path,
314-
"metadata": metadata,
315+
"metadata": metadata_dict,
315316
"face_id": face_id,
316317
"confidence": confidence,
317318
"bbox": bbox,

0 commit comments

Comments
 (0)