-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f78a4cb
commit f238fd1
Showing
8 changed files
with
39 additions
and
84 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,31 +1,32 @@ | ||
# To run this example please download the PascalVOC 2007 dataset first: | ||
# | ||
# wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar | ||
# tar -xvf VOCtrainval_06-Nov-2007.tar | ||
|
||
from pathlib import Path | ||
|
||
from labelformat.formats import YOLOv8ObjectDetectionInput | ||
from labelformat.formats import PascalVOCObjectDetectionInput | ||
|
||
from lightly_insights import analyze, present | ||
|
||
|
||
def main() -> None: | ||
# Analyze an image folder. | ||
image_folder = Path("/Users/michal/datasets/aquarium.v2-release.yolov8/test/images") | ||
image_analysis = analyze.analyze_images(image_folder=image_folder) | ||
|
||
# Analyze object detections. | ||
input_file = Path("/Users/michal/datasets/aquarium.v2-release.yolov8/data.yaml") | ||
label_input = YOLOv8ObjectDetectionInput( | ||
input_file=input_file, | ||
input_split="test", | ||
) | ||
od_analysis = analyze.analyze_object_detections(label_input=label_input) | ||
|
||
# Create HTML report. | ||
output_folder = Path("/Users/michal/tmp/lightly_insights_output") | ||
present.create_html_report( | ||
output_folder=output_folder, | ||
image_analysis=image_analysis, | ||
od_analysis=od_analysis, | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() | ||
# Analyze an image folder. | ||
image_analysis = analyze.analyze_images( | ||
image_folder=Path("./VOCdevkit/VOC2007/JPEGImages") | ||
) | ||
|
||
# Analyze object detections. | ||
label_input = PascalVOCObjectDetectionInput( | ||
input_folder=Path("./VOCdevkit/VOC2007/Annotations"), | ||
category_names=( | ||
"person,bird,cat,cow,dog,horse,sheep,aeroplane,bicycle,boat,bus,car," | ||
"motorbike,train,bottle,chair,diningtable,pottedplant,sofa,tvmonitor" | ||
), | ||
) | ||
od_analysis = analyze.analyze_object_detections(label_input=label_input) | ||
|
||
# Create HTML report. | ||
present.create_html_report( | ||
output_folder=Path("./html_report"), | ||
image_analysis=image_analysis, | ||
od_analysis=od_analysis, | ||
) |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
from lightly_insights import main | ||
|
||
|
||
def test_main() -> None: | ||
main.main() | ||
def test() -> None: | ||
# Testing infrasctructure is set up! | ||
assert True |