Spaces:
Sleeping
Sleeping
Commit
·
2f34187
1
Parent(s):
0949a48
update: sprite path for firebase
Browse files- crop_utils.py +38 -3
crop_utils.py
CHANGED
|
@@ -326,17 +326,47 @@ def get_sprite_firebase(cid, rsid, uid):
|
|
| 326 |
"appId": f"{os.getenv('FIREBASE_APP_ID')}",
|
| 327 |
"measurementId": f"{os.getenv('FIREBASE_MEASUREMENT_ID')}",
|
| 328 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 329 |
|
| 330 |
firebase = pyrebase.initialize_app(config)
|
| 331 |
db = firebase.database()
|
| 332 |
account_id = os.getenv("ROLL_ACCOUNT")
|
|
|
|
| 333 |
|
| 334 |
COLLAB_EDIT_LINK = "collab_sprite_link_handler"
|
| 335 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 336 |
path = f"{account_id}/{COLLAB_EDIT_LINK}/{uid}/{cid}/{rsid}"
|
| 337 |
|
| 338 |
data = db.child(path).get()
|
| 339 |
-
|
| 340 |
return data.val()
|
| 341 |
|
| 342 |
|
|
@@ -1587,9 +1617,14 @@ def get_image_crop(cid=None, rsid=None, uid=None):
|
|
| 1587 |
gr.Gallery: Gallery of all generated images
|
| 1588 |
"""
|
| 1589 |
try:
|
| 1590 |
-
|
|
|
|
|
|
|
| 1591 |
except Exception:
|
| 1592 |
-
image_paths = [
|
|
|
|
|
|
|
|
|
|
| 1593 |
|
| 1594 |
# Lists to store all images
|
| 1595 |
all_images = []
|
|
|
|
| 326 |
"appId": f"{os.getenv('FIREBASE_APP_ID')}",
|
| 327 |
"measurementId": f"{os.getenv('FIREBASE_MEASUREMENT_ID')}",
|
| 328 |
}
|
| 329 |
+
config = {
|
| 330 |
+
"apiKey": "AIzaSyBCa7GE6rJfKuLWkgo6LwauGtrvU1IMEr0",
|
| 331 |
+
"authDomain": "roll-staging.firebaseapp.com",
|
| 332 |
+
"databaseURL": "https://roll-staging-default-rtdb.firebaseio.com",
|
| 333 |
+
"projectId": "roll-staging",
|
| 334 |
+
"storageBucket": "roll-staging.appspot.com",
|
| 335 |
+
"messagingSenderId": "362091959122",
|
| 336 |
+
"appId": "1:362091959122:web:c58a6f11e02b8bd7c0208b",
|
| 337 |
+
"measurementId": "G-SJ81T1K35B",
|
| 338 |
+
}
|
| 339 |
|
| 340 |
firebase = pyrebase.initialize_app(config)
|
| 341 |
db = firebase.database()
|
| 342 |
account_id = os.getenv("ROLL_ACCOUNT")
|
| 343 |
+
account_id = "roll-dev-account"
|
| 344 |
|
| 345 |
COLLAB_EDIT_LINK = "collab_sprite_link_handler"
|
| 346 |
|
| 347 |
+
cid = "rmkc-8vyj-g5gm_2025-03-19T193720"
|
| 348 |
+
uid = "8db1de69-e551-11ee-9761-026931562a5d"
|
| 349 |
+
rsid = "2025-03-19T193728"
|
| 350 |
+
{
|
| 351 |
+
"p_name": "Ahmad Anis",
|
| 352 |
+
"p_email": "ahmad@roll.ai",
|
| 353 |
+
"p_uid": "165a1035-022a-11ef-938d-027e4558976f",
|
| 354 |
+
"p_role": "HOST",
|
| 355 |
+
"p_id": 196,
|
| 356 |
+
"f_id": "c2aa6e66-faaa-4234-84ad-66f582efd839",
|
| 357 |
+
"f_name": "A1 AhmadA webWebcam",
|
| 358 |
+
"f_type": "Webcam",
|
| 359 |
+
"callId": "dhnn-3gn2-stzs_2025-03-18T214100",
|
| 360 |
+
"callDeviceId": "acb7ff23-73ec-4204-b196-48f78996bWEB",
|
| 361 |
+
"recordingSessionId": "2025-03-18T214133",
|
| 362 |
+
"time": "18 Mar 2025, 21:41:33",
|
| 363 |
+
"timestamp": 1742334093000,
|
| 364 |
+
"timerange": "1742333493000 - 1742337693000",
|
| 365 |
+
}
|
| 366 |
+
|
| 367 |
path = f"{account_id}/{COLLAB_EDIT_LINK}/{uid}/{cid}/{rsid}"
|
| 368 |
|
| 369 |
data = db.child(path).get()
|
|
|
|
| 370 |
return data.val()
|
| 371 |
|
| 372 |
|
|
|
|
| 1617 |
gr.Gallery: Gallery of all generated images
|
| 1618 |
"""
|
| 1619 |
try:
|
| 1620 |
+
sprites_data = get_sprite_firebase(cid, rsid, uid)
|
| 1621 |
+
image_paths = [sprite_data["url"] for sprite_data in sprites_data]
|
| 1622 |
+
durations = [sprite_data["duration"] for sprite_data in sprites_data]
|
| 1623 |
except Exception:
|
| 1624 |
+
image_paths = [
|
| 1625 |
+
"data/C2-Roll3D-i2x-Take2-Nov19.24-PST02.31.31pm.jpg",
|
| 1626 |
+
"data/E2-HamzaA-i2x-Take2-Nov19.24-PST02.31.31pm.jpg",
|
| 1627 |
+
]
|
| 1628 |
|
| 1629 |
# Lists to store all images
|
| 1630 |
all_images = []
|