Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/opencv-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: actions-setup-cmake
uses: jwlawson/actions-setup-cmake@v1.13.1
with:
cmake-version: 3.24
cmake-version: 3.28

- name: Checkout
uses: actions/checkout@v3
Expand Down
57 changes: 34 additions & 23 deletions anchor/backend/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,44 @@
# November 14 Dataset Documentation
(All datasets recorded with the lab iPhone 12 Pro)

All maps recorded with half on lights in Paul's lab
All maps recorded with half on lights in Paul's lab at night

Maps:
ayush_nov_14_3 - Basic sweep of Paul's lab
ayush_nov30_1 - Basic sweep of Paul's lab
- start point: Ayush ACE #1 (front left corner of lab table when facing into the lab)
- test: mimics mapping path
- testing_0AC24C4E-C4D2-4B9E-952D-0C44A2752EC2_ayush_nov_14_3: stay in the end part of paul's lab
- testing_26077932-EFC7-4B24-B7C6-DC6878E6B0D4_ayush_nov_14_3.tar : two lights on, full lab sweep
- testing_D942AA09-5F83-4A4A-9CED-D69B203027FD_ayush_nov_14_3.tar : lights off, full labish

ayush_nov_14_4 - Start in Paul's lab, record QEA room
- start point: ACE Testing #1 (front corner of lab iMac Table)
- test: mimics mapping path
- testing_46F804E3-8948-43D0-BF64-2B7F00D6663F_ayush_nov_14_4.tar : random point in qea room as start
- testing_916E83DA-EB88-45D1-94FF-3A9705C91A0C_ayush_nov_14_4.tar : dim lights in qea room
- testing_632F9815-002B-4E7E-8BF2-ACA38DC26F4B_ayush_nov_14_4.tar : fast movement during localization in qea room
- test: mimics the mapping path
- testing_94D0E0FA-969F-42A9-9B6E-90750E8A28E9_ayush_nov30_1.tar: stay in the end part of paul's lab (same lighting)
- testing_834D9882-2910-4E2B-8CAB-F0FC0FB1C915_ayush_nov30_1.tar: start in the front of the lab, two lights on
- testing_F1567117-3BB1-497F-957F-FBECF9F56F33_ayush_nov30_1.tar: start in end part of lab, walk out and into the QEA room
- testing_B5227C47-2A46-4619-BCDF-242A5EE57075_ayush_nov30_1.tar: (MIGHT BE BAD) start in the end part, all lights off (cloud anchor didn't resolve)
- testing_5CA55EC2-488A-496C-8C64-D03EB170ACAD_ayush_nov30_1.tar: SANITY BAD! SHOULD BE BAD! just recorded in the QEA room (cloud anchor didn't resolve)
- testing_0668C249-AB9A-4A2C-988F-F6ED3A420894_ayush_nov30_1.tar: random starting point in daylight
- testing_D417435B-C2A0-40DF-A1B2-C09F143AB6D7_ayush_nov30_1.tar: random starting point in daylight
- testing_8E1E9222-15B0-4BDD-B9B1-3922F88E2B4B_ayush_nov30_1.tar: in daylight but with light on

ayush_nov_14_5 - Record Paul's lab and QEA room
- start point: Ayush ACE #1 (front left corner of lab table when facing into the lab)
- test: just localize in paul's lab
- testing_A88A09D0-DD39-4E9B-9688-93096690EB59_ayush_nov_14_5.tar : just qea room
- testing_1378446C-16A7-42D7-AE0A-FE15AF107C5C_ayush_nov_14_5.tar : furniture moved in pauls lab, just pauls lab
ayush_nov30_2 - Map of Paul's lab and QEA room
- start point: Ayush ACE #2 (higher window near door)
- test: mimics the mapping path
- testing_CD81156C-5CE9-49E8-B9C7-9754914CB715_ayush_nov30_2.tar: just paul's lab
- testing_ED89FDB3-A754-41AE-B91D-5F5C8E92F67D_ayush_nov30_2.tar: just QEA room
- testing_C7CB77B3-A217-43A5-AA4B-4900D0BB9021_ayush_nov30_2.tar: just qea room, dim lights
- testing_16365A15-B546-4914-9A65-9ECC76BB7D9E_ayush_nov30_2.tar: move furniture in paul's lab

ayush_nov30_3 - Map of front of Paul's lab and then out to the left (no reverse)
- start point: Ayush ACE #2 (higher window near door)
- test: go out and to the left
- testing_A804ACC8-4C4E-47DF-AD1B-2E456C9D7CDA_ayush_nov30_3.tar: mostly pauls lab and just outside
- testing_CBF93574-5FCA-4A88-A00E-01CEE08F9E11_ayush_nov30_3.tar: midpoint
- testing_0A955FDD-89AF-4207-A17B-44B0A1541B6C_ayush_nov30_3.tar: start at the end, move in reverse (cloud anchor only resolved at the end)
- testing_BC2FB0E7-E9F3-4B81-837E-41680333D199_ayush_nov30_3.tar: start in the middle, continue down the hall and then reverse in daylight
- testing_74725AA6-D3C8-40CD-8019-972387C48EF5_ayush_nov30_3.tar: reversed the path in daylight (cloud anchor didn't resolve)
- testing_0942DC39-D49D-4FC4-A721-268748280751_ayush_nov30_3.tar: start in pauls lab and go down the hall in daylight

ayush_nov_14_6 - Start in Paul's lab, walk out and to the left in the MAC (going for distance)
- start point: Ayush ACE #2 (higher window sill near door)
ayush_nov30_4 - Immediately go out and right from Paul's lab and reverse'
- start point: Ayush ACE #2 (higher window near door)
- test: mimics mapping path
- testing_DB7B5083-3DF2-4B7B-94C3-58092F11AB4D_ayush_nov_14_6.tar : turned opposite direction, should have no localization
- testing_5F8501A2-AC9B-4E0C-8F47-3B66C6842071_ayush_nov_14_6.tar : started halfway down path, continued to end
- testing_585B19F6-1149-4406-BD34-042D4EC3E2CC_ayush_nov_14_6.tar : started at end, walked in reverse
- testing_5C9197A3-C808-4512-897C-E94498D69F71_ayush_nov30_4.tar: walked the path in reverse starting in hallway and went into paul's lab
- testing_8B4E3C56-4FE0-4201-9DEB-3E158E10C53F_ayush_nov30_4.tar: out and to the left (SHOULD BE BAD?)
- testing_B66BBDB8-9392-4706-A7B6-5489C4A1CB60_ayush_nov30_4.tar: walked the forward path in daylight
- testing_F17CD6F2-48AB-420C-8AB7-640582635008_ayush_nov30_4.tar: walked the reverse path in daylight
- testing_F6183FC7-FA99-4DE8-9D3B-E04F6431BE5D_ayush_nov30_4.tar: walked forward in daylight (lower inlier count)
58 changes: 31 additions & 27 deletions anchor/backend/data/ace.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def process_localization_phase(
}
)

tmp_pose_path = Path(__file__).parent / "jsons/temp_pose_data.json"
tmp_pose_path = Path(__file__).parent / ".cache/jsons/temp_pose_data.json"
with open(tmp_pose_path, "w") as file:
json.dump({"data": poses}, file, indent=4)

Expand Down Expand Up @@ -271,21 +271,21 @@ def process_training_data(combined_path: str, downloader: FirebaseDownloader):

print("[INFO]: Running ace training on dataset path: ", extracted_ace_folder)
os.chdir(Path(__file__).parent.parent.parent / "third_party/ace")
subprocess.run(
[
"./train_ace.py",
extracted_ace_folder.as_posix(),
model_output.as_posix(),
"--render_visualization",
str(visualizer_enabled),
"--render_flipped_portrait",
str(render_flipped_portrait),
"--render_target_path",
render_target_path.as_posix(),
"--epochs",
str(training_epochs),
]
)
# subprocess.run(
# [
# "./train_ace.py",
# extracted_ace_folder.as_posix(),
# model_output.as_posix(),
# "--render_visualization",
# str(visualizer_enabled),
# "--render_flipped_portrait",
# str(render_flipped_portrait),
# "--render_target_path",
# render_target_path.as_posix(),
# "--epochs",
# str(training_epochs),
# ]
# )

print("[INFO]: Running ace evaluation on dataset path: ", extracted_ace_folder)
run_ace_evaluator(
Expand Down Expand Up @@ -315,8 +315,7 @@ def process_training_data(combined_path: str, downloader: FirebaseDownloader):
print("[INFO]: Moved tar from tarQueue to processedTars directory in firebase")

ace_test_pose_file = (
Path(tempfile.gettempdir())
/ f"benchmark/{Path(tar_name).stem}/ace/poses_ace_.txt"
downloader.root_download_dir / f"{Path(tar_name).stem}/ace/poses_ace_.txt"
)
process_localization_phase(combined_path, downloader, ace_test_pose_file, True)

Expand Down Expand Up @@ -372,14 +371,20 @@ def process_testing_data(combined_path: str, downloader: FirebaseDownloader):
extracted_ace_folder = downloader.local_extraction_location / "ace"
model_name = Path(combined_path).stem.split("training_")[-1]
model_name = "_".join(model_name.split("_")[2:])
model_data_folder = (
Path(tempfile.gettempdir()) / f"benchmark/training_{model_name}/ace"
)
model_weights_path = model_data_folder / "model.pt"
if not model_weights_path.exists():
downloader.download_file(
f"iosLoggerDemo/trainedModels/{model_name}.pt", model_weights_path
)

for (dir, _, _) in os.walk(downloader.root_download_dir):
dir_path = Path(dir)
if str(dir_path).endswith(model_name) and dir_path.parts[-1].startswith("training_"):
model_data_folder = Path(dir) / "ace"
model_weights_path = model_data_folder / "model.pt"
break
else:
raise NotImplementedError
# if not model_weights_path.exists():
# downloader.download_file(
# f"iosLoggerDemo/trainedModels/{model_name}.pt", model_weights_path
# )

ace_test_pose_file = model_data_folder / "poses_ace_.txt"
run_ace_evaluator(
extracted_ace_folder, model_weights_path, False, True, extracted_ace_folder
Expand Down Expand Up @@ -418,7 +423,6 @@ def process_testing_data(combined_path: str, downloader: FirebaseDownloader):
)

downloader.extract_ios_logger_tar()

if Path(combined_path).parts[-1].startswith("training"):
process_training_data(combined_path, downloader)
elif Path(combined_path).parts[-1].startswith("testing"):
Expand Down
27 changes: 12 additions & 15 deletions anchor/backend/data/firebase.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ def list_tars():
initialize_app(cred)
FirebaseDownloader.initialized = True
bucket = storage.bucket(FirebaseDownloader.firebase_bucket_name)
tar_queue = "iosLoggerDemo/tarQueue/"
tar_queue = "iosLoggerDemo/processedTrainingTars/"
tars = bucket.list_blobs(prefix=tar_queue)

tar_names = []

for tar in tars:
print(tar.name)
if tar.name.endswith(".tar"):
if tar.name.endswith(".tar") and "ayush_april_7" in tar.name:
tar_names.append(tar.name)

return tar_names
Expand All @@ -44,7 +43,7 @@ class FirebaseDownloader:
initialized: bool = False

# the root of where we download
root_download_dir: Path = Path(tempfile.gettempdir()) / "benchmark"
root_download_dir: Path = Path(__file__).parent / ".cache/firebase_data"

def __init__(self, firebase_dir: str, tar_name: str):
# initialize_app should be called only once globally
Expand Down Expand Up @@ -103,26 +102,24 @@ def extract_ios_logger_tar(self) -> Path:
f"[INFO]: Downloaded tar {self.tar_name} as it has not been found locally"
)

# # unpack the tar itself and cleanup and previous extractions
# shutil.rmtree(self.local_extraction_location, ignore_errors=True)
# shutil.unpack_archive(
# self.local_tar_location, extract_dir=self.local_extraction_location
# )
shutil.unpack_archive(
self.local_tar_location, extract_dir=self.local_extraction_location
)

# extract the videos by phase (test videos will not have mapping data so they need to be handled separately)
if (self.local_extraction_location / "mapping-video.mp4").exists():
self.extract_ios_logger_video(
self.local_extraction_location / "mapping-video.mp4", True
)
# self.extract_ios_logger_video(
# self.local_extraction_location / "mapping-video.mp4", True
# )
self.extract_intrinsics(self.local_extraction_location, True)
self.extract_pose(self.local_extraction_location, True)
self.extract_april_tags(self.local_extraction_location, True)
self.extract_google_cloud_anchors(self.local_extraction_location, True)

if (self.local_extraction_location / "localization-video.mp4").exists():
self.extract_ios_logger_video(
self.local_extraction_location / "localization-video.mp4", False
)
# self.extract_ios_logger_video(
# self.local_extraction_location / "localization-video.mp4", False
# )
self.extract_intrinsics(self.local_extraction_location, False)
self.extract_pose(self.local_extraction_location, False)
self.extract_april_tags(self.local_extraction_location, False)
Expand Down
Loading