Skip to content

Commit

Permalink
assert fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dingguanglei committed Jan 11, 2019
1 parent 62c2cdc commit c7c97c9
Show file tree
Hide file tree
Showing 11 changed files with 301 additions and 288 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[![](http://img.shields.io/travis/dingguanglei/jdit.svg)](https://github.com/dingguanglei/jdit)
[![Documentation Status](https://readthedocs.org/projects/jdit/badge/?version=latest)](https://jdit.readthedocs.io/en/latest/?badge=latest)
[![codebeat badge](https://codebeat.co/badges/f8c6cfa5-5e6b-499c-b318-2656bc91cab0)](https://codebeat.co/projects/github-com-dingguanglei-jdit-master)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/1a5aa0721e2f44ebb61b0b73627bbc90)](https://www.codacy.com/app/dingguanglei/jdit?utm_source=github.com&utm_medium=referral&utm_content=dingguanglei/jdit&utm_campaign=Badge_Grade)
![Packagist](https://img.shields.io/hexpm/l/plug.svg)
![pypi download](https://img.shields.io/pypi/dm/jdit.svg)

Expand Down Expand Up @@ -37,23 +37,25 @@ pip install -r requirements.txt
```
### From source
This method is recommended, because you can keep the newest version.
1. Clone from github
1. Clone from github
```
git clone https://github.com/dingguanglei/jdit
```
2. Setup

2. Setup
By using `setup.py` to install the package.
```
python setup.py bdist_wheel
```
3. Install

3. Install
You will find packages in `jdit/dist/`. Use pip to install.
```
pip install dist/jdit-0.0.x-py3-none-any.whl
```

### From pip
```
``` {.sourceCode .bash}
pip install jdit
```

Expand Down
10 changes: 5 additions & 5 deletions jdit/assessment/fid.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
from torch.nn.functional import adaptive_avg_pool2d


class _InceptionV3(nn.Module):
class InceptionV3(nn.Module):
"""Pretrained _InceptionV3 network returning feature maps"""

# Index of default block of inception to return,
Expand All @@ -63,7 +63,7 @@ class _InceptionV3(nn.Module):
}

def __init__(self,
output_blocks=[DEFAULT_BLOCK_INDEX],
output_blocks=(DEFAULT_BLOCK_INDEX,),
resize_input=True,
normalize_input=True,
requires_grad=False):
Expand All @@ -89,7 +89,7 @@ def __init__(self,
If true, parameters of the model require gradient. Possibly useful
for finetuning the network
"""
super(_InceptionV3, self).__init__()
super(InceptionV3, self).__init__()

self.resize_input = resize_input
self.normalize_input = normalize_input
Expand Down Expand Up @@ -184,9 +184,10 @@ def forward(self, inp):

return outp


# ______________________________________________________________

def compute_act_statistics_from_loader(dataloader:DataLoader, model, gpu_ids):
def compute_act_statistics_from_loader(dataloader: DataLoader, model, gpu_ids):
"""
:param dataloader:
Expand Down Expand Up @@ -414,4 +415,3 @@ def FID_score(source, target, sample_prop=1.0, gpu_ids=(), dim=2048, batchsize=1

fid_value = calculate_frechet_distance(s_mu, s_sigma, t_mu, t_sigma)
return fid_value

0 comments on commit c7c97c9

Please sign in to comment.