Skip to content

Phash - #105

Merged
sanjanag merged 27 commits into
mainfrom
phash
Feb 24, 2023
Merged

Phash#105
sanjanag merged 27 commits into
mainfrom
phash

Conversation

@sanjanag

@sanjanag sanjanag commented Feb 22, 2023 •

Copy link
Copy Markdown
Contributor

Bug fixes:

  • Visualize only top issues in imagelab.report()
  • Raise exception on passing an empty list of files in imagelab.visualize()

Improvements:

  • Updated thresholds for issue types based on these datasets : our example dataset, cifar10, caltech256, food101, cubs2011, weather, intel
  • Changed logic of dark and light issues: get nth percentile for. brightness of each pixel tune that value for threshold, helps with false positives containing objects in dark/light backgrounds.
  • Show scores on top of each image instead of filename in imagelab.visualize(issue_types)
  • Changed default hash near_duplicates hash to phash
  • For exact duplicates calculate pixel value hash instead of image object hash

Refactoring

  • ImageProperty scores passed around in the code as pandas series instead of list, also helps in maintaining indexes.
  • ImageProperty.calculate returns dict instead of a single value
  • Introduced score_column property in ImageProperty for specifying which series to use for evaluating scores

📚 Documentation preview 📚: https://cleanvision--105.org.readthedocs.build/en/105/

@sanjanag sanjanag self-assigned this Feb 22, 2023
@sanjanag
sanjanag requested a review from jwmueller February 22, 2023 23:26
@sanjanag
sanjanag marked this pull request as ready for review February 22, 2023 23:26
@sanjanag
sanjanag requested a review from elisno February 22, 2023 23:26
@codecov

codecov Bot commented Feb 22, 2023 •

Copy link
Copy Markdown

Codecov Report

Merging #105 (0a27c93) into main (c237143) will decrease coverage by 1.82%.
The diff coverage is 34.30%.

@@            Coverage Diff             @@
##             main     #105      +/-   ##
==========================================
- Coverage   37.28%   35.47%   -1.82%     
==========================================
  Files           9        9              
  Lines         649      733      +84     
  Branches      127      153      +26     
==========================================
+ Hits          242      260      +18     
- Misses        403      469      +66     
  Partials        4        4              
Impacted Files Coverage Δ
src/cleanvision/imagelab.py 0.00% <0.00%> (ø)
src/cleanvision/utils/viz_manager.py 0.00% <0.00%> (ø)
...ion/issue_managers/image_property_issue_manager.py 35.43% <17.74%> (-8.78%) ⬇️
...anvision/issue_managers/duplicate_issue_manager.py 52.10% <50.00%> (-0.85%) ⬇️
src/cleanvision/utils/utils.py 34.28% <50.00%> (+0.95%) ⬆️
src/cleanvision/issue_managers/image_property.py 54.96% <58.44%> (-7.42%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Comment thread src/cleanvision/imagelab.py Resolved
Comment thread src/cleanvision/imagelab.py Resolved
Comment thread src/cleanvision/imagelab.py Resolved
][property_name]
self.info[issue_type] = imagelab_info.get(issue_type, {})

# todo: revisit when there are more issues using same properties like light and dark

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the intention to map compatible issues to each other based on the shared property?

Suppose an issue (e.g. LIGHT) is valid (exists in self.issue_types) but is not set in self.info. Do we assume its counterpart (e.g. DARK) has been set with the desired property?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. In imagelab.find_issues I get a defer set of issues to re-use computations. This defer set will add, all but one of the compatible issues to the defer set. These left out issues will be populated using the one that was left out of defer set.

Comment thread tests/test_image_property_helpers.py Resolved

@jwmueller jwmueller left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

messaged you all my comments for easier discussion, but I think they can be addressed in future PRs (or this one if you can get to them in time and then re-request my review)

sanjanag and others added 4 commits February 23, 2023 14:13
Co-authored-by: Elías Snorrason <eliassno@gmail.com>
Co-authored-by: Elías Snorrason <eliassno@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants