Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore non-image files in ns-process-data #1040

Merged
merged 3 commits into from
Nov 28, 2022
Merged
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
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,14 @@ dev = [

# Documentation related packages
docs = [
"furo==2022.4.7",
"furo==2022.09.29",
# Specifying ipython for https://github.com/ipython/ipython/issues/13845
"ipython==8.6.0",
"readthedocs-sphinx-search==0.1.2",
"myst-nb==0.16.0",
"nbconvert==7.2.5",
"nbformat==5.5.0",
"sphinx==4.5.0",
"sphinx==5.2.1",
"sphinxemoji==0.2.0",
"sphinx-argparse==0.3.1",
"sphinx-copybutton==0.5.0",
Expand Down
9 changes: 6 additions & 3 deletions scripts/process_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@ def main(self) -> None:
record3d_image_filenames = []
for f in record3d_image_dir.iterdir():
if f.stem.isdigit(): # removes possible duplicate images (for example, 123(3).jpg)
record3d_image_filenames.append(f)
if f.suffix.lower() in [".jpg", ".jpeg", ".png", ".tif", ".tiff"]:
record3d_image_filenames.append(f)

record3d_image_filenames = sorted(record3d_image_filenames, key=lambda fn: int(fn.stem))
num_images = len(record3d_image_filenames)
Expand Down Expand Up @@ -436,7 +437,8 @@ def main(self) -> None:

polycam_image_filenames = []
for f in polycam_image_dir.iterdir():
polycam_image_filenames.append(f)
if f.suffix.lower() in [".jpg", ".jpeg", ".png", ".tif", ".tiff"]:
polycam_image_filenames.append(f)
polycam_image_filenames = sorted(polycam_image_filenames, key=lambda fn: int(fn.stem))
num_images = len(polycam_image_filenames)
idx = np.arange(num_images)
Expand Down Expand Up @@ -528,7 +530,8 @@ def main(self) -> None:
# Copy images to output directory
image_filenames = []
for f in self.data.iterdir():
image_filenames.append(f)
if f.suffix.lower() in [".jpg", ".jpeg", ".png", ".tif", ".tiff"]:
image_filenames.append(f)
image_filenames = sorted(image_filenames, key=lambda fn: fn.stem)
num_images = len(image_filenames)
idx = np.arange(num_images)
Expand Down