Skip to content
Snippets Groups Projects
Commit d1f91dff authored by Low, Low Jian He (PG/R - Comp Sci & Elec Eng)'s avatar Low, Low Jian He (PG/R - Comp Sci & Elec Eng)
Browse files

commenting lmdb for test

parent 1862c216
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,7 @@ import matplotlib.pyplot as plt
import matplotlib.patches as patches
import gc
import shutil
import lmdb, pickle
# import lmdb, pickle
from hamer.configs import CACHE_DIR_HAMER
from hamer.models import HAMER, download_models, load_hamer, DEFAULT_CHECKPOINT
......@@ -217,44 +217,44 @@ def main(args, model, renderer, device):
# Pickling Protocol set to 4
protocol = 4
with lmdb.open(path=str(Temp_Database), map_size=n_bytes) as env:
with env.begin(write=True) as txn:
for index,feat in enumerate(global_orient_list):
txn.put(
key=f"{File_Name}_GOrient_{index}".encode("ascii"),
value=pickle.dumps(feat, protocol=protocol),
dupdata=False,
)
with env.begin(write=True) as txn:
for index,feat in enumerate(hand_pose_list):
txn.put(
key=f"{File_Name}_HPose_{index}".encode("ascii"),
value=pickle.dumps(feat, protocol=protocol),
dupdata=False,
)
with env.begin(write=True) as txn:
txn.put(
key=("pred_cam").encode("ascii"),
value=pickle.dumps(pred_cam_list, protocol=protocol),
dupdata=False,
)
# with lmdb.open(path=str(Temp_Database), map_size=n_bytes) as env:
# with env.begin(write=True) as txn:
# for index,feat in enumerate(global_orient_list):
# txn.put(
# key=f"{File_Name}_GOrient_{index}".encode("ascii"),
# value=pickle.dumps(feat, protocol=protocol),
# dupdata=False,
# )
# with env.begin(write=True) as txn:
# for index,feat in enumerate(hand_pose_list):
# txn.put(
# key=f"{File_Name}_HPose_{index}".encode("ascii"),
# value=pickle.dumps(feat, protocol=protocol),
# dupdata=False,
# )
# with env.begin(write=True) as txn:
# txn.put(
# key=("pred_cam").encode("ascii"),
# value=pickle.dumps(pred_cam_list, protocol=protocol),
# dupdata=False,
# )
with env.begin(write=True) as txn:
txn.put(
key=("betas").encode("ascii"),
value=pickle.dumps(betas_list, protocol=protocol),
dupdata=False,
)
with env.begin(write=True) as txn:
txn.put(
key=("details").encode("ascii"),
value=pickle.dumps({"num_features": list_length, "fps": fps, "focal_length": focal_length}, protocol=protocol),
dupdata=False,
)
shutil.move(f"{Temp_Database}", args.out_folder)
# with env.begin(write=True) as txn:
# txn.put(
# key=("betas").encode("ascii"),
# value=pickle.dumps(betas_list, protocol=protocol),
# dupdata=False,
# )
# with env.begin(write=True) as txn:
# txn.put(
# key=("details").encode("ascii"),
# value=pickle.dumps({"num_features": list_length, "fps": fps, "focal_length": focal_length}, protocol=protocol),
# dupdata=False,
# )
# shutil.move(f"{Temp_Database}", args.out_folder)
print(f"Total time taken: {(time.time()-initial_start_time)/60:.2f} minutes")
if __name__ == '__main__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment