Skip to content

Commit

Permalink
update v0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
w86763777 committed Nov 19, 2021
1 parent f4179c4 commit 6a2620d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ pip install pytorch-gan-metrics
| |Train IS |Test IS |Train(50k) vs Test(10k)<br>FID|
|-------------------|:--------:|:--------:|:----------------------------:|
|Official |11.24±0.20|10.98±0.22|3.1508 |
|pytorch-gan-metrics|11.26±0.27|10.97±0.33|3.1517 |
|pytorch-gan-metrics<br>`use_torch=True`|11.26±0.21|10.97±0.34|3.1377 |
|pytorch-gan-metrics|11.26±0.08|10.97±0.32|3.1517 |
|pytorch-gan-metrics<br>`use_torch=True`|11.26±0.08|10.97±0.34|3.1455 |

The results are slightly different from official implementations due to the framework difference between PyTorch and TensorFlow.

Expand Down
4 changes: 3 additions & 1 deletion pytorch_gan_metrics/calc_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
help='path to image directory')
parser.add_argument('--stats', type=str, required=True,
help='precalculated reference statistics')
parser.add_argument('--use_torch', action='store_true',
help='using pytorch as the matrix operations backend')
args = parser.parse_args()

dataset = ImageDataset(args.path, exts=['png', 'jpg'])
loader = DataLoader(dataset, batch_size=50, num_workers=4)
(IS, IS_std), FID = get_inception_score_and_fid(
loader, args.stats, verbose=True)
loader, args.stats, use_torch=args.use_torch, verbose=True)
print(IS, IS_std, FID)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def read(rel_path):
if __name__ == '__main__':
setuptools.setup(
name='pytorch_gan_metrics',
version='0.4.0',
version='0.4.1',
author='Yi-Lun Wu',
author_email='[email protected]',
description=('Package for calculating GAN metrics using Pytorch'),
Expand Down

0 comments on commit 6a2620d

Please sign in to comment.