From 80bb26ef72e33e8681218207054114d34b94eaaa Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Wed, 12 Apr 2023 07:24:03 +0000 Subject: automatic import of python-grad-cam --- .gitignore | 1 + python-grad-cam.spec | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 101 insertions(+) create mode 100644 python-grad-cam.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..34bca35 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/grad-cam-1.4.6.tar.gz diff --git a/python-grad-cam.spec b/python-grad-cam.spec new file mode 100644 index 0000000..10836a2 --- /dev/null +++ b/python-grad-cam.spec @@ -0,0 +1,99 @@ +%global _empty_manifest_terminate_build 0 +Name: python-grad-cam +Version: 1.4.6 +Release: 1 +Summary: Many Class Activation Map methods implemented in Pytorch for classification, segmentation, object detection and more +License: MIT License +URL: https://github.com/jacobgil/pytorch-grad-cam +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/d8/6b/f3b4e6e2c869f4757dc627993f22d48400a5c5247fa44a590ecd847c6bb4/grad-cam-1.4.6.tar.gz +BuildArch: noarch + + +%description +# Chosing the Target Layer +You need to choose the target layer to compute CAM for. +Some common choices are: +- FasterRCNN: model.backbone +- Resnet18 and 50: model.layer4[-1] +- VGG and densenet161: model.features[-1] +- mnasnet1_0: model.layers[-1] +- ViT: model.blocks[-1].norm1 +- SwinT: model.layers[-1].blocks[-1].norm1 +If you pass a list with several layers, the CAM will be averaged accross them. + +%package -n python3-grad-cam +Summary: Many Class Activation Map methods implemented in Pytorch for classification, segmentation, object detection and more +Provides: python-grad-cam +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-grad-cam +# Chosing the Target Layer +You need to choose the target layer to compute CAM for. +Some common choices are: +- FasterRCNN: model.backbone +- Resnet18 and 50: model.layer4[-1] +- VGG and densenet161: model.features[-1] +- mnasnet1_0: model.layers[-1] +- ViT: model.blocks[-1].norm1 +- SwinT: model.layers[-1].blocks[-1].norm1 +If you pass a list with several layers, the CAM will be averaged accross them. + +%package help +Summary: Development documents and examples for grad-cam +Provides: python3-grad-cam-doc +%description help +# Chosing the Target Layer +You need to choose the target layer to compute CAM for. +Some common choices are: +- FasterRCNN: model.backbone +- Resnet18 and 50: model.layer4[-1] +- VGG and densenet161: model.features[-1] +- mnasnet1_0: model.layers[-1] +- ViT: model.blocks[-1].norm1 +- SwinT: model.layers[-1].blocks[-1].norm1 +If you pass a list with several layers, the CAM will be averaged accross them. + +%prep +%autosetup -n grad-cam-1.4.6 + +%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-grad-cam -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed Apr 12 2023 Python_Bot - 1.4.6-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..cbeb46c --- /dev/null +++ b/sources @@ -0,0 +1 @@ +3a45962a8c7e6fb397330b3187a1ac58 grad-cam-1.4.6.tar.gz -- cgit v1.2.3