Skip to content

Commit

Permalink
📦 Rename package to piqa and deploy on PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
francois-rozet committed Dec 5, 2020
1 parent ec3518e commit 9bfa13c
Show file tree
Hide file tree
Showing 15 changed files with 42 additions and 34 deletions.
32 changes: 20 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,41 @@
# Simple PyTorch Image Quality
# PyTorch Image Quality Assessment

This package is a collection of measures and metrics for image quality assessment in various image processing tasks such as denoising, super-resolution, image interpolation, etc. It relies heavily on [PyTorch](https://github.com/pytorch/pytorch) and takes advantage of its efficiency and automatic differentiation.

It should noted that `spiq` is directly inspired from the [`piq`](https://github.com/photosynthesis-team/piq) project. However, it focuses on the conciseness, readability and understandability of its (sub-)modules, such that anyone can freely and easily reuse and/or adapt them to its needs.
It should noted that `piqa` is directly inspired from the [`piq`](https://github.com/photosynthesis-team/piq) project. However, it focuses on the conciseness, readability and understandability of its (sub-)modules, such that anyone can freely and easily reuse and/or adapt them to its needs.

> `piqa` should be pronounced *pika* (like Pikachu ⚡️)
## Installation

To install the current version of `spiq`,
The `piqa` package is available on [PyPI](https://pypi.org/project/piqa/), which means it is installable with `pip`:

```bash
pip install piqa
```

Alternatively, if you need the lastest features, you can install it using

```bash
git clone https://github.com/francois-rozet/spiq
cd spiq
git clone https://github.com/francois-rozet/piqa
cd piqa
python setup.py install
```

You can also copy the package directly to your project.
or copy the package directly to your project, with

```bash
git clone https://github.com/francois-rozet/spiq
cd spiq
cp -R spiq <path/to/project>/spiq
git clone https://github.com/francois-rozet/piqa
cd piqa
cp -R piqa <path/to/project>/piqa
```

## Getting started

```python
import torch
import spiq.psnr as psnr
import spiq.ssim as ssim
import piqa.psnr as psnr
import piqa.ssim as ssim

x = torch.rand(3, 3, 256, 256)
y = torch.rand(3, 3, 256, 256)
Expand All @@ -42,6 +50,6 @@ l = criterion(x, y)

## Documentation

The [documentation](https://francois-rozet.github.io/spiq/) of this package is generated automatically using [`pdoc`](https://github.com/pdoc3/pdoc).
The [documentation](https://francois-rozet.github.io/piqa/) of this package is generated automatically using [`pdoc`](https://github.com/pdoc3/pdoc).

> The code follows the [Google Python style](https://google.github.io/styleguide/pyguide.html) and is compliant with [YAPF](https://github.com/google/yapf).
8 changes: 4 additions & 4 deletions docs.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Env
source ~/spiq/bin/activate
source ~/piqa/bin/activate

# Master
git checkout master

# Generate HTML
pdoc spiq --html --force \
--config "git_link_template='https://github.com/francois-rozet/spiq/blob/{commit}/{path}#L{start_line}-L{end_line}'" \
pdoc piqa --html --force \
--config "git_link_template='https://github.com/francois-rozet/piqa/blob/{commit}/{path}#L{start_line}-L{end_line}'" \
--config "show_inherited_members=True" \
--config "latex_math=True"

Expand All @@ -15,7 +15,7 @@ git checkout docs
git reset --hard master

mkdir docs -p
mv html/spiq/* docs/
mv html/piqa/* docs/
rm -rf html

git add docs/*
Expand Down
8 changes: 8 additions & 0 deletions piqa/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
r"""PyTorch Image Quality Assessement
The piqa package is divided in several submodules, each of
which implements the functions and/or classes related to a
specific image quality assessement metric.
"""

__version__ = '1.0.0'
2 changes: 1 addition & 1 deletion spiq/gmsd.py → piqa/gmsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import torch.nn as nn
import torch.nn.functional as F

from spiq.utils import build_reduce, prewitt_kernel, gradient2d, tensor_norm
from piqa.utils import build_reduce, prewitt_kernel, gradient2d, tensor_norm

_L_WEIGHTS = torch.FloatTensor([0.2989, 0.587, 0.114])

Expand Down
2 changes: 1 addition & 1 deletion spiq/lpips.py → piqa/lpips.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import torch.nn as nn
import torchvision.models as models

from spiq.utils import build_reduce, normalize_tensor, Intermediary
from piqa.utils import build_reduce, normalize_tensor, Intermediary

_SHIFT = torch.Tensor([0.485, 0.456, 0.406])
_SCALE = torch.Tensor([0.229, 0.224, 0.225])
Expand Down
2 changes: 1 addition & 1 deletion spiq/mdsi.py → piqa/mdsi.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import torch.nn as nn
import torch.nn.functional as F

from spiq.utils import build_reduce, prewitt_kernel, gradient2d, tensor_norm
from piqa.utils import build_reduce, prewitt_kernel, gradient2d, tensor_norm

_LHM_WEIGHTS = torch.FloatTensor([
[0.2989, 0.587, 0.114],
Expand Down
2 changes: 1 addition & 1 deletion spiq/psnr.py → piqa/psnr.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import torch
import torch.nn as nn

from spiq.utils import build_reduce
from piqa.utils import build_reduce

from typing import Tuple

Expand Down
2 changes: 1 addition & 1 deletion spiq/ssim.py → piqa/ssim.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import torch.nn as nn
import torch.nn.functional as F

from spiq.utils import build_reduce, gaussian_kernel
from piqa.utils import build_reduce, gaussian_kernel

from typing import Tuple

Expand Down
2 changes: 1 addition & 1 deletion spiq/tv.py → piqa/tv.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import torch
import torch.nn as nn

from spiq.utils import build_reduce, tensor_norm
from piqa.utils import build_reduce, tensor_norm


def tv(x: torch.Tensor, norm: str = 'L2') -> torch.Tensor:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
required = f.read().splitlines()

setuptools.setup(
name='spiq',
version='0.0.2',
description='Image quality metrics in PyTorch',
name='piqa',
version='1.0.0',
description='PyTorch Image Quality Assessment',
long_description=readme,
long_description_content_type='text/markdown',
keywords='pytorch image processing metrics',
author='François Rozet',
author_email='[email protected]',
url='https://github.com/francois-rozet/spiq',
url='https://github.com/francois-rozet/piqa',
install_requires=required,
packages=setuptools.find_packages(),
classifiers=[
Expand Down
8 changes: 0 additions & 8 deletions spiq/__init__.py

This file was deleted.

0 comments on commit 9bfa13c

Please sign in to comment.