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

Fix pipeline #2

Merged
merged 1 commit into from
Mar 19, 2024
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
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[flake8]
max-line-length = 88
extend-ignore = E203
extend-ignore = E203, F722, F821
7 changes: 1 addition & 6 deletions thermo_nerf/flir_thermal_images/custom_flir.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@

import numpy as np
import pandas as pd
from FlirImageExtractor.flir_image_extractor import FlirImageExtractor
from matplotlib import cm
from PIL import Image

from FlirImageExtractor.flir_image_extractor import FlirImageExtractor


def get_min_max_temperatures(path_to_csv_files: str) -> tuple[float, float]:
"""
Expand Down Expand Up @@ -87,10 +86,6 @@ def save_normalised_thermal_images(
self.absolute_max_temperature,
)

# temperature = temperature.reshape(640, 480)
# image = Image.fromarray(temperature)
# image.save(Path(path_to_thermal_images_curated, Path(path).stem + ".tiff"))

gray_scale_image = temperature.reshape(640, 480).astype("uint8")

Image.fromarray(gray_scale_image, mode="L").save(
Expand Down
3 changes: 2 additions & 1 deletion thermo_nerf/thermal_nerf/thermal_dataparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ def _generate_dataparser_outputs(self, split: str = "train") -> DataparserOutput

poses[:, :3, 3] *= scale_factor

# Choose image_filenames and poses based on split, but after auto orient and scaling the poses.
# Choose image_filenames and poses based on split, but after auto orient
# and scaling the poses.
image_filenames = [image_filenames[i] for i in indices]

thermal_filenames = (
Expand Down
3 changes: 2 additions & 1 deletion thermo_nerf/thermal_nerf/thermal_field_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ def forward(
"""
if not self.net:
raise SystemError(
"in_dim not set. Must be provided to constructor, or set_in_dim() should be called."
"in_dim not set. Must be provided to constructor, or set_in_dim()"
" should be called."
)
out_tensor = self.net(in_tensor)
if self.activation:
Expand Down
3 changes: 2 additions & 1 deletion thermo_nerf/thermal_nerf/thermal_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def combine_thermal(
num_rays: Optional[int] = None,
) -> Float[Tensor, "*bs 3"]:
"""Composite samples along ray and render color image.
If background color is random, no BG color is added - as if the background was black!
If background color is random, no BG color is added - as if the background was
black!

Args:
thermal: thermal for each sample
Expand Down