cobanov / tasnif

A Python toolkit for image clustering using deep learning, PCA, and K-means, with support for GPU and CPU processing. Simplify your image analysis projects with advanced embeddings, dimensionality reduction, and automated visual categorization.
MIT License
31 stars 3 forks source link

Pre-calculation Checks and Embedding Exports #1

Closed yunusstalha closed 4 months ago

yunusstalha commented 4 months ago

I implemented a safeguard in the calculation method to ensure that PCA and k-means clustering calculations are only performed if images have been successfully read into the system. I added the ability to export image embeddings to a specified directory as a ".npy" file through the export_embeddings method.

cobanov commented 4 months ago

Thank you for your support, I wonder if you think raising an error message instead of a print would be a better option?

 if not value:
        raise ValueError("Value must be a positive integer")
yunusstalha commented 4 months ago

Thank you for your support; I wonder if you think raising an error message instead of a print would be a better option?

 if not value:
        raise ValueError("Value must be a positive integer")

I've switched to raising errors instead of just warnings to clearly indicate that certain actions are not permitted, ensuring users are immediately aware of the issue.

cobanov commented 4 months ago

Perfect.