-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change the path to save temperature bound json file
- Loading branch information
1 parent
86cb0cf
commit ee4f3fc
Showing
6 changed files
with
83 additions
and
31 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import shutil | ||
import unittest | ||
from pathlib import Path | ||
|
||
from thermo_scenes.flir_thermal_images.custom_flir import CustomFlir | ||
|
||
|
||
class TestThermalConversion(unittest.TestCase): | ||
def test_process_thermal(self) -> None: | ||
""" | ||
Test of extracting RGB, thermal and csv files from the given msx images. | ||
2 msx images will generate 2 RGB PNG files, 2 thermal PNG files, 2 csv files | ||
and 1 temperature_bound.json file. | ||
""" | ||
msx_path = Path("tests/data/process_thermal/msx") | ||
output_path = Path("tests/data/process_thermal/output") | ||
|
||
shutil.rmtree(output_path) | ||
output_path.mkdir(exist_ok=True, parents=True) | ||
|
||
CustomFlir(path_to_msx_images=msx_path, path_to_output_folder=output_path) | ||
|
||
json_count = 0 | ||
PNG_count = 0 | ||
csv_count = 0 | ||
|
||
for folder in output_path.iterdir(): | ||
if folder.suffix == ".json": | ||
json_count += 1 | ||
continue | ||
for files in folder.iterdir(): | ||
if files.suffix == ".PNG": | ||
PNG_count += 1 | ||
elif files.suffix == ".csv": | ||
csv_count += 1 | ||
|
||
self.assertEqual(json_count, 1, "The number of the JSON file is not correct!") | ||
self.assertEqual(PNG_count, 4, "The number of the PNG files is not correct!") | ||
self.assertEqual(csv_count, 2, "The number of the CSV files is not correct!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters