donghuna commited on
Commit
8b2bb9b
ยท
verified ยท
1 Parent(s): 9a900e5

Update handler.py

Browse files
Files changed (1) hide show
  1. 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