summaryrefslogtreecommitdiff
path: root/python-ssim-pil.spec
diff options
context:
space:
mode:
Diffstat (limited to 'python-ssim-pil.spec')
-rw-r--r--python-ssim-pil.spec180
1 files changed, 180 insertions, 0 deletions
diff --git a/python-ssim-pil.spec b/python-ssim-pil.spec
new file mode 100644
index 0000000..3479ab8
--- /dev/null
+++ b/python-ssim-pil.spec
@@ -0,0 +1,180 @@
+%global _empty_manifest_terminate_build 0
+Name: python-SSIM-PIL
+Version: 1.0.14
+Release: 1
+Summary: Comparison of two images using the structural similarity algorithm (SSIM).
+License: MIT License
+URL: https://github.com/ChsHub/SSIM-PIL
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/23/c3/5538bdb2654005bc162d4fdf49c21de11fb03d317077d21c885d950febbc/SSIM-PIL-1.0.14.tar.gz
+BuildArch: noarch
+
+
+%description
+# SSIM-PIL
+Comparison of two images using the structural similarity algorithm (SSIM).
+The resulting value varies between 1.0 for identical images and 0.0 for completely different images.
+It's based on the PIL and also supports GPU acceleration via pyopencl.
+
+## Installation
+`python3 -m pip install SSIM-PIL`
+
+Be sure to install a working version of pyopencl to benefit from faster parallel execution on the GPU. (The code was
+tested with OpenCl version 1.2.)
+
+## Usage Example
+
+```python
+
+from SSIM_PIL import compare_ssim
+from PIL import Image
+
+image1 = Image.open(path)
+image2 = Image.open(path)
+
+# Compare images using OpenCL by default
+value = compare_ssim(image1, image2)
+print(value)
+
+# Compare images using CPU-only version
+value = compare_ssim(image1, image2, GPU=False)
+print(value)
+
+```
+
+## Feedback
+
+For feedback please contact me over github: https://github.com/ChsHub/SSIM-PIL.
+
+
+
+
+%package -n python3-SSIM-PIL
+Summary: Comparison of two images using the structural similarity algorithm (SSIM).
+Provides: python-SSIM-PIL
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-SSIM-PIL
+# SSIM-PIL
+Comparison of two images using the structural similarity algorithm (SSIM).
+The resulting value varies between 1.0 for identical images and 0.0 for completely different images.
+It's based on the PIL and also supports GPU acceleration via pyopencl.
+
+## Installation
+`python3 -m pip install SSIM-PIL`
+
+Be sure to install a working version of pyopencl to benefit from faster parallel execution on the GPU. (The code was
+tested with OpenCl version 1.2.)
+
+## Usage Example
+
+```python
+
+from SSIM_PIL import compare_ssim
+from PIL import Image
+
+image1 = Image.open(path)
+image2 = Image.open(path)
+
+# Compare images using OpenCL by default
+value = compare_ssim(image1, image2)
+print(value)
+
+# Compare images using CPU-only version
+value = compare_ssim(image1, image2, GPU=False)
+print(value)
+
+```
+
+## Feedback
+
+For feedback please contact me over github: https://github.com/ChsHub/SSIM-PIL.
+
+
+
+
+%package help
+Summary: Development documents and examples for SSIM-PIL
+Provides: python3-SSIM-PIL-doc
+%description help
+# SSIM-PIL
+Comparison of two images using the structural similarity algorithm (SSIM).
+The resulting value varies between 1.0 for identical images and 0.0 for completely different images.
+It's based on the PIL and also supports GPU acceleration via pyopencl.
+
+## Installation
+`python3 -m pip install SSIM-PIL`
+
+Be sure to install a working version of pyopencl to benefit from faster parallel execution on the GPU. (The code was
+tested with OpenCl version 1.2.)
+
+## Usage Example
+
+```python
+
+from SSIM_PIL import compare_ssim
+from PIL import Image
+
+image1 = Image.open(path)
+image2 = Image.open(path)
+
+# Compare images using OpenCL by default
+value = compare_ssim(image1, image2)
+print(value)
+
+# Compare images using CPU-only version
+value = compare_ssim(image1, image2, GPU=False)
+print(value)
+
+```
+
+## Feedback
+
+For feedback please contact me over github: https://github.com/ChsHub/SSIM-PIL.
+
+
+
+
+%prep
+%autosetup -n SSIM-PIL-1.0.14
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-SSIM-PIL -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Wed May 10 2023 Python_Bot <Python_Bot@openeuler.org> - 1.0.14-1
+- Package Spec generated