Spaces:
Sleeping
Sleeping
Update video_processing.py
Browse files- video_processing.py +6 -2
video_processing.py
CHANGED
@@ -12,6 +12,10 @@ from torchvision import models, transforms
|
|
12 |
from torch.nn import functional as F
|
13 |
from cachetools import cached, TTLCache
|
14 |
import numpy as np
|
|
|
|
|
|
|
|
|
15 |
|
16 |
|
17 |
categories = ["Joy", "Trust", "Fear", "Surprise", "Sadness", "Disgust", "Anger", "Anticipation"]
|
@@ -26,8 +30,8 @@ resnet50 = models.resnet50(pretrained=True).eval().to(device)
|
|
26 |
|
27 |
#initialize caches
|
28 |
scene_cache = TTLCache(maxsize=100, ttl=86400) # cache up to 100 items, each for 1 day
|
29 |
-
frame_cache = TTLCache(maxsize=
|
30 |
-
analysis_cache = TTLCache(maxsize=
|
31 |
|
32 |
|
33 |
def cache_info_decorator(func, cache):
|
|
|
12 |
from torch.nn import functional as F
|
13 |
from cachetools import cached, TTLCache
|
14 |
import numpy as np
|
15 |
+
import logging
|
16 |
+
|
17 |
+
# Setup basic logging
|
18 |
+
logging.basicConfig(level=logging.INFO)
|
19 |
|
20 |
|
21 |
categories = ["Joy", "Trust", "Fear", "Surprise", "Sadness", "Disgust", "Anger", "Anticipation"]
|
|
|
30 |
|
31 |
#initialize caches
|
32 |
scene_cache = TTLCache(maxsize=100, ttl=86400) # cache up to 100 items, each for 1 day
|
33 |
+
frame_cache = TTLCache(maxsize=1000, ttl=86400)
|
34 |
+
analysis_cache = TTLCache(maxsize=1000, ttl=86400)
|
35 |
|
36 |
|
37 |
def cache_info_decorator(func, cache):
|