Spectra is an image processing algorithm designed to detect scenes, similarity, and blur in time ordered image databases. The algorithm is capable of categorizing images by scene and giving suggestions to the user to review and delete similar and or blurry images.
Spectra operates completely offline and creates .spectra_data
and .spectra_temp
files in every directory analyzed in order to speed up the analysis of that directory in the future.
Spectra currently supports JPG, JPEG, PNG, and TIFF file formats.
Spectra is officially compatible with macOS and popular Linux distributions in a python3 environment.
Spectra requires several dependencies to operate as a command line utility. You must have the latest version of python3
and pip3
installed on your computer to use the program. You will also need to install the latest packages of PIL, shutil, cv2, imagehash, numpy, scipy, skimage, and sklearn. These packages should be setup automatically by the installation script that is included with this repository, so its not necessary to manually install all of them.
Please navigate to the release tab of this repository and download the latest version of this project. You can perform this download within a browser environment or using a command line utility like wget
or curl
. Alternatively, you can clone this repository but it is recommended that you download the most recent release as the git repository is comparatively larger.
Then, navigate to the location where the Spectra repository contents have been downloaded onto your machine and run the install_spectra installation script. This executable will install Spectra in a hidden directory called ~/.spectra
and install all the dependencies required by Spectra, assuming that you have python3
and pip3
installed on your machine. When the installation script finishes, source your terminal profile and restart your terminal to fully configure the installation.
If you would like to do a manual installation of Spectra, all you need to do is move the repository contents you downloaded, besides the install_spectra file, into a folder at ~/.spectra
which you will have to create yourself. Then source and restart your terminal profile after adding the following command to your terminal profile.
function spectra() {
command python3 ~/.spectra/bin/spectra.py "$@"
}
Spectra takes up to four input values. The image path is the only required argument to run the script and must always be the first argument passed to Spectra. The sensitivity flags on the other hand are optional and can be indicated in any order to Spectra. It is not necessary to indicate the sensitivity thresholds since there are default values for them internally that work for most image repositories. However, if you need to indicate a sensitivity threshold, you can simpily indicate the flag and the sensitivity expressed as a percentage from 0 to 100, where 100 percent sensitivity results in the most sensitive image processing.
command spectra <path> <-b blur_sensitivity> <-s scene_sensitivity> <-d duplicate_sensitivity>