Skip to content

Commit

Permalink
Merge pull request #35 from UNC-Libraries/bxc-4682
Browse files Browse the repository at this point in the history
BXC-4682 - Remove html component of segmentation report
  • Loading branch information
sharonluong authored Sep 11, 2024
2 parents 81b2d0d + d680fc7 commit 50f6346
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 155 deletions.
4 changes: 2 additions & 2 deletions create_seg_report.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Script which generates an HTML report from a CSV document created by segmenter_predict.py
# Script which generates a CSV report document and preview images from outcome of segmenter_predict.py
from src.utils.segmentation_report_service import SegmentationReportService
from src.utils.classifier_config import ClassifierConfig
from pathlib import Path
Expand All @@ -7,7 +7,7 @@

parser = argparse.ArgumentParser()
parser.add_argument('-f', '--file-path', type=Path, required=True,
help="Path to csv file that will be used to generate html page.")
help="Path to csv file that will be used to generate report.")
parser.add_argument('-d', '--output-path', type=Path, default=False, required=False,
help="Path of the directory to write the report out to. Defaults to src/report")
parser.add_argument('-c', '--config', type=Path,
Expand Down
149 changes: 0 additions & 149 deletions src/reports/seg_report.html

This file was deleted.

1 change: 0 additions & 1 deletion src/tests/test_segmentation_report_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def test_generate(self, tmp_path, config):
service = SegmentationReportService(csv_path, report_path, config)
service.generate()

assert (report_path / 'report.html').is_file()
assert (report_path / 'data.csv').is_file()
data_wrapper = from_json(report_path / 'data.json')
data = data_wrapper['data']
Expand Down
3 changes: 0 additions & 3 deletions src/utils/segmentation_report_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,13 @@ def __init__(self, csv_path, report_path, config):
self.report_path = report_path
self.images_path = report_path / 'images'
self.config = config
# self.norms_relative_path = Path(norms_relative_path).resolve()
self.original_data = False
self.output_data = []
self.normalizer = ImageNormalizer(config)

def generate(self):
# create output directory and images subdirectory
self.images_path.mkdir(parents=True, exist_ok=True)
# copy html page
shutil.copyfile('src/reports/seg_report.html', self.report_path / 'report.html')
# copy in csv file
shutil.copyfile(self.csv_path, self.report_path / 'data.csv')
# begin processing csv file
Expand Down

0 comments on commit 50f6346

Please sign in to comment.