Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
from datetime import datetime
|
3 |
import tempfile
|
@@ -5,6 +6,9 @@ import os
|
|
5 |
import json
|
6 |
import torch
|
7 |
import gc
|
|
|
|
|
|
|
8 |
from PIL import Image
|
9 |
from decord import VideoReader, cpu
|
10 |
from yolo_detection import (
|
@@ -29,6 +33,7 @@ global_media_path = None
|
|
29 |
tmp_dir = os.path.join('.', 'tmp')
|
30 |
os.makedirs(tmp_dir, exist_ok=True)
|
31 |
|
|
|
32 |
def process_diary(day, date, total_people, total_machinery, machinery_types, activities, media):
|
33 |
"""Process the site diary entry"""
|
34 |
global global_activities, global_media_path
|
@@ -460,4 +465,4 @@ with gr.Blocks(title="Digital Site Diary", css="") as demo:
|
|
460 |
""")
|
461 |
|
462 |
if __name__ == "__main__":
|
463 |
-
demo.launch(
|
|
|
1 |
+
import spaces
|
2 |
import gradio as gr
|
3 |
from datetime import datetime
|
4 |
import tempfile
|
|
|
6 |
import json
|
7 |
import torch
|
8 |
import gc
|
9 |
+
def debug():
|
10 |
+
torch.randn(10).cuda()
|
11 |
+
debug()
|
12 |
from PIL import Image
|
13 |
from decord import VideoReader, cpu
|
14 |
from yolo_detection import (
|
|
|
33 |
tmp_dir = os.path.join('.', 'tmp')
|
34 |
os.makedirs(tmp_dir, exist_ok=True)
|
35 |
|
36 |
+
@spaces.GPU
|
37 |
def process_diary(day, date, total_people, total_machinery, machinery_types, activities, media):
|
38 |
"""Process the site diary entry"""
|
39 |
global global_activities, global_media_path
|
|
|
465 |
""")
|
466 |
|
467 |
if __name__ == "__main__":
|
468 |
+
demo.launch(allowed_paths=["./tmp"])
|