이현규

Create sample featuremaps

No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -28,6 +28,9 @@ VOCAB_PATH = "./statics/vocabulary.csv"
TAG_TOP_K = 5
VIDEO_TOP_K = 10
# Target featuremap.
FEATUREMAP_PATH = "./featuremaps/toy-3-features.pb"
def get_segments(batch_video_mtx, batch_num_frames, segment_size):
"""Get segment-level inputs from frame-level features."""
video_batch_size = batch_video_mtx.shape[0]
......@@ -229,8 +232,7 @@ def inference_pb(file_path, threshold):
if __name__ == '__main__':
filepath = "./featuremaps/features.pb"
result = inference_pb(filepath, 5)
result = inference_pb(FEATUREMAP_PATH, 5)
print("=============== Old Model ===============")
print(result["tag_result"])
print(json.dumps(result["video_result"], sort_keys=True, indent=2))
......@@ -240,6 +242,6 @@ if __name__ == '__main__':
TAG_VECTOR_MODEL_PATH = "./new_model/tag_vectors.model"
VIDEO_VECTOR_MODEL_PATH = "./new_model/video_vectors.model"
VIDEO_TAGS_PATH = "./statics/new_kaggle_solution_40k.csv"
result = inference_pb(filepath, 5)
result = inference_pb(FEATUREMAP_PATH, 5)
print("=============== New Model ===============")
print(json.dumps(result, sort_keys=True, indent=2))
......