|
1 | 1 | # Copyright 2019-2020 Stanislav Pidhorskyi
|
2 | 2 | #
|
3 |
| -# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
4 | 6 | #
|
5 |
| -# This work is licensed under the Creative Commons Attribution-NonCommercial |
6 |
| -# 4.0 International License. To view a copy of this license, visit |
7 |
| -# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to |
8 |
| -# Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | +# ============================================================================== |
9 | 15 |
|
10 |
| -"""Perceptual Path Length (PPL).""" |
11 | 16 |
|
12 | 17 | import dnnlib.tflib
|
13 | 18 | import pickle
|
|
28 | 33 | import utils
|
29 | 34 |
|
30 | 35 | dnnlib.tflib.init_tf()
|
31 |
| -tf_config = {'rnd.np_random_seed': 1000} |
32 | 36 |
|
33 | 37 | download.from_google_drive('1CIDc9i070KQhHlkr4yIwoJC8xqrwjE0_', directory="metrics")
|
34 | 38 |
|
@@ -145,7 +149,7 @@ def sample(cfg, logger):
|
145 | 149 | encoder = nn.DataParallel(encoder)
|
146 | 150 |
|
147 | 151 | with torch.no_grad():
|
148 |
| - ppl = LPIPS(cfg, num_images=10000, minibatch_size=8 * torch.cuda.device_count()) |
| 152 | + ppl = LPIPS(cfg, num_images=10000, minibatch_size=16 * torch.cuda.device_count()) |
149 | 153 | ppl.evaluate(logger, mapping_fl, decoder, encoder, cfg.DATASET.MAX_RESOLUTION_LEVEL - 2)
|
150 | 154 |
|
151 | 155 |
|
|
0 commit comments