ngxquang commited on
Commit
f409417
1 Parent(s): 587ac1d

add 'folder' to responses

Browse files
Files changed (2) hide show
  1. Dockerfile +1 -1
  2. src/itr/dtb_cursor.py +6 -1
Dockerfile CHANGED
@@ -36,4 +36,4 @@ COPY --chown=user . $HOME/app
36
 
37
  RUN bash $HOME/app/download_models.sh
38
 
39
- CMD python ./src/main.py
 
36
 
37
  RUN bash $HOME/app/download_models.sh
38
 
39
+ CMD ["python", "./src/main.py"]
src/itr/dtb_cursor.py CHANGED
@@ -34,11 +34,13 @@ class DatabaseCursor:
34
  ):
35
  with open(keyframes_groups_json_path) as file:
36
  keyframes_group_info = json.loads(file.read())
 
37
  with open(subframes_groups_json_path) as file:
38
  subframes_groups_info = json.loads(file.read())
 
 
39
  self.frames_groups_info = keyframes_group_info
40
  self.frames_groups_info.extend(subframes_groups_info)
41
-
42
  assert self.index.ntotal == len(
43
  self.frames_groups_info
44
  ), "dtb_cursos::Index length and map lenght mismatch"
@@ -49,5 +51,8 @@ class DatabaseCursor:
49
  for i in range(len(ids[0])):
50
  frame_detail = self.frames_groups_info[ids[0][i]]
51
  frame_detail["distance"] = str(distances[0][i])
 
 
 
52
  results.append(frame_detail)
53
  return results
 
34
  ):
35
  with open(keyframes_groups_json_path) as file:
36
  keyframes_group_info = json.loads(file.read())
37
+ self.no_keyframes = len(keyframes_group_info)
38
  with open(subframes_groups_json_path) as file:
39
  subframes_groups_info = json.loads(file.read())
40
+ self.no_subframes = len(subframes_groups_info)
41
+
42
  self.frames_groups_info = keyframes_group_info
43
  self.frames_groups_info.extend(subframes_groups_info)
 
44
  assert self.index.ntotal == len(
45
  self.frames_groups_info
46
  ), "dtb_cursos::Index length and map lenght mismatch"
 
51
  for i in range(len(ids[0])):
52
  frame_detail = self.frames_groups_info[ids[0][i]]
53
  frame_detail["distance"] = str(distances[0][i])
54
+ frame_detail["folder"] = (
55
+ "Keyframes" if ids[0][i] < self.no_keyframes else "Subframes"
56
+ )
57
  results.append(frame_detail)
58
  return results