Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port CNN to pytorch, other major changes #173

Merged
merged 11 commits into from
Oct 14, 2022
Merged

Port CNN to pytorch, other major changes #173

merged 11 commits into from
Oct 14, 2022

Conversation

tanujjain
Copy link
Collaborator

The Pull request comes with major changes.

Supported Python versions

  1. The support for Python 3.6 has been withdrawn (Several major dependencies have withdrawn support for Python 3.6, including scipy, Pillow-9.0+, matplotlib-3.6)
  2. Python 3.7 will reach end-of-life on 2023-06-27. Hence, Python 3.7 is also not supported.
  3. Python versions supported: 3.8+.

CNN

  1. The underlying framework for CNN has been changed from tensorflow to pytorch (supported through torchvision).
  2. The underlying CNN model is now a MobilenetV3 instead of Mobilenetv2.
  3. The size of embeddings generated by CNN is now 576 instead of 1024 (The embeddings remain robust).
  4. Using GPU to generate encodings with CNN is currently not possible.

Hashing

  • Due to changes to the resize function of Pillow over several versions, the hashing methods do not yield the same hashes as the previous versions of imagededup (which forced Pillow version to be <7.0.0). This leads to different hashes being generated for the same image across different imagededup versions. (All hashing methods are impacted since they all rely upon Pillow's resizing method). The hashes work reliably, so there's no impact on the functionality per se.

Todos after this PR has been merged

  • Update example notebooks.
  • Allow the use of GPU for using CNN methods.
  • Update Benchmarks.
  • Allow multiprocessing in pytorch dataloader.

@tanujjain tanujjain merged commit af0e90a into dev Oct 14, 2022
tanujjain added a commit that referenced this pull request Oct 14, 2022
…ngs (#175)

* Bump version to 0.2.4.

* Update builtin.h (#123)

* Update readme to reflect changes in TF 2.1.

* Bump version to 0.2.4. (#122)

* Update builtin.h

respelled keyword as taking to some malicious site.

Co-authored-by: Dat Tran <datitran@gmail.com>
Co-authored-by: Tanuj Jain <tanujjain@users.noreply.github.com>

* Add recursive option in encode_image() (#104)

* Update tests for new recursive option

* Add recursive option

to the following functions:
encode_image()
find_duplicates()
find_duplicates_to_remove()

Recusive is off by default.

* Add tests for recursive option

* Modify tests to ignore hidden files '.DS_Store' that are automatically created on mac by the Finder application. (#131)

* Port CNN to pytorch, other major changes (#173)

* Add feature generation with mobilenet v3.

* Integrate multi image encoding generation in CNN class.

* Update tests to adhere to new cnn embeddings as well as new hashes generated.

* Change antialias resampling to lanczos as antialias is deprecated and maps to lanczos in latest pillow versions. Also fix tests to adapt cnn scores, hashes.

* Clean up code to consolidate preprocessing in one place.

* Add tests for data generator.

* Update documentation to reflect the changes occurring due to the use of pytorch mobilenet v3 instead of tensorflow mobilenetv2.

* Update readme to remove tensorflow specifics.

* Update version for Pillow to be minimum 9.0 (released beginning of Jan 2022). Also update description to reflect python version support.

* Update requirements.txt and do some cleanup.

* Update travis and azure-pipelines os versions.

Co-authored-by: danidavid <33230485+danidavid@users.noreply.github.com>
Co-authored-by: Dat Tran <datitran@gmail.com>
Co-authored-by: Emilv2 <emil@vanherp.me>
@tanujjain tanujjain deleted the port/pytorch branch October 28, 2022 13:46
@ImportTaste
Copy link

Wait, does this mean 0.3.0 doesn't support generating with the GPU? That wasn't mentioned in the release notes.

@tanujjain
Copy link
Collaborator Author

Wait, does this mean 0.3.0 doesn't support generating with the GPU? That wasn't mentioned in the release notes.

Not at the moment, but the fix has already been merged to dev branch. Will be creating a new release soon.

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.

None yet

2 participants