Skip to content

Commit

Permalink
Added docstrings for Imagelab module, class, public methods and attri…
Browse files Browse the repository at this point in the history
…butes (#91)

* Added docstrings for Imagelab() and get_filepaths()

* Added docstring for Imagelab._set_default_config()

* Added docstring for imagelab.visualize()

* Added docstrings in Imagelab.find_issues()

* Added spacing in visualize documentation

* Added docstrings for Imagelab.list_possible_issue_types()

* Added examples in Imagelab.visualize()

* Added docstrings for Imagelab.report()

* Added docstrings for Imagelab.load()

* Added docstrings for Imagelab class

* Added docstrings for imagelab.py module

* Fixed codeblock formatting

* Added docstring to Imagelab.save()

* Update src/cleanvision/utils/utils.py

Co-authored-by: Elías Snorrason <[email protected]>

* Update src/cleanvision/imagelab.py

Co-authored-by: Elías Snorrason <[email protected]>

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Added newline after code-block for proper formatting in sphinx documentation

* Improved docstrings

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Changed style of param type

* Added cross references

* Docstring formatting improvements

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Removed examlpes_per_issue argument from visualize

* Removed docstring for examples_per_issue

* Added argument filepaths to Imagelab()

* Renamed {issue_type}_bool column to is_{issue_type}_issue

* Fixed mypy annotations

* Added an argument to avoid overwriting files by default

* Removed multiple import lines from same package

* Removed an extra line

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Resolved comment

* Resolved comment

* Specify only one of data_path or filepaths, in all other cases throw ValueError

* Added documentation for n_jobs

* Improved docs formatting

* Improved docs formatting

* Fixed get_max_n_jobs

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Fixed flake8 error

* Fixed mypy error

* Update src/cleanvision/imagelab.py

Co-authored-by: Jonas Mueller <[email protected]>

* Renamed allow_overwrite to force

* Updated imagelab.report()
- Removed num_top_issues argument as it is unnecessary and can be controlled by verbosity
- Changed max_prevalence to filter out issues in both cases where no issue_types are specified and also where issue_types are specified

* Filter issues first and then limit by number of issues to report

* Added print statement to indicate more issues were found

---------

Co-authored-by: Elías Snorrason <[email protected]>
Co-authored-by: Jonas Mueller <[email protected]>
  • Loading branch information
3 people authored Feb 18, 2023
1 parent eeb8781 commit ec5ef9e
Show file tree
Hide file tree
Showing 5 changed files with 381 additions and 95 deletions.
18 changes: 9 additions & 9 deletions examples/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
This example demonstrates the default Imagelab workflow to detect various types of issues in an image dataset.
"""

imagelab = Imagelab(dataset_path) # initalize imagelab
imagelab = Imagelab(data_path=dataset_path) # initialize imagelab
imagelab.list_default_issue_types() # list default checks
imagelab.visualize() # visualize random images in dataset

Expand All @@ -24,12 +24,12 @@

print("Summary of all issues checks\n", imagelab.issue_summary.to_markdown())
imagelab.visualize(
issue_types=["blurry"], examples_per_issue=8
issue_types=["blurry"], num_images=8
) # visualize images that have specific issues

# Get all images with blurry issue type
blurry_images = imagelab.issues[
imagelab.issues["blurry_bool"] == True
imagelab.issues["is_blurry_issue"] == True
].index.to_list()
imagelab.visualize(image_files=blurry_images) # visualize the given image files

Expand All @@ -42,14 +42,14 @@
Example 2
This example demonstrates using Imagelab to:
1. Check data for specific types of issues
1. Check data for specific types of issues
2. Incrementally detect additional types of issues with existing Imagelab
3. Specify nondefault parameter to use when detecting a particular issue type (e.g. a different threshold)
4. Save and load Imagelab to file
5. Report only specific issue types
"""

imagelab = Imagelab(dataset_path)
imagelab = Imagelab(data_path=dataset_path)
issue_types = {"near_duplicates": {}}
imagelab.find_issues(issue_types)
imagelab.report()
Expand Down Expand Up @@ -78,7 +78,7 @@
4. Increase the size of images in the grid displayed by visualize
"""

imagelab = Imagelab(dataset_path)
imagelab = Imagelab(data_path=dataset_path)
imagelab.find_issues()
imagelab.report(["near_duplicates"])

Expand All @@ -93,10 +93,10 @@

# Report arg values here will overwrite verbosity defaults
# Find top examples suffering from issues that are not present in more than 1% of the dataset
imagelab.report(num_top_issues=5, max_prevalence=0.01)
imagelab.report(max_prevalence=0.01)

# Increase cell_size in the grid
imagelab.visualize(issue_types=["light"], examples_per_issue=8, cell_size=(3, 3))
imagelab.visualize(issue_types=["light"], num_images=8, cell_size=(3, 3))

"""
Example 4
Expand All @@ -106,7 +106,7 @@
# Run imagelab on custom issue
from custom_issue_manager import CustomIssueManager

imagelab = Imagelab(dataset_path)
imagelab = Imagelab(data_path=dataset_path)
issue_name = CustomIssueManager.issue_name
imagelab.list_possible_issue_types()

Expand Down
Loading

0 comments on commit ec5ef9e

Please sign in to comment.