Update handler.py
Browse files- handler.py +8 -0
handler.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import numpy as np
|
2 |
import torch
|
3 |
from transformers import TimesformerForVideoClassification
|
|
|
4 |
import logging
|
5 |
|
6 |
# ๋ก๊น
์ค์
|
@@ -17,6 +18,13 @@ class EndpointHandler:
|
|
17 |
self.model.eval()
|
18 |
|
19 |
def __call__(self, data):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
# ๋๋ฒ๊น
: ์
๋ ฅ ๋ฐ์ดํฐ ํ์ธ
|
21 |
logger.info(f"Received data: {data}")
|
22 |
|
|
|
1 |
import numpy as np
|
2 |
import torch
|
3 |
from transformers import TimesformerForVideoClassification
|
4 |
+
from preprocessing import read_video
|
5 |
import logging
|
6 |
|
7 |
# ๋ก๊น
์ค์
|
|
|
18 |
self.model.eval()
|
19 |
|
20 |
def __call__(self, data):
|
21 |
+
video_path = data["inputs"]["video_path"]
|
22 |
+
ftp_password = data["inputs"].get("ftp_password")
|
23 |
+
|
24 |
+
processed_frames = read_video(vide_path, ftp_password)
|
25 |
+
|
26 |
+
|
27 |
+
|
28 |
# ๋๋ฒ๊น
: ์
๋ ฅ ๋ฐ์ดํฐ ํ์ธ
|
29 |
logger.info(f"Received data: {data}")
|
30 |
|