google-research

Форк
0
34 строки · 1.1 Кб
1
# coding=utf-8
2
# Copyright 2024 The Google Research Authors.
3
#
4
# Licensed under the Apache License, Version 2.0 (the "License");
5
# you may not use this file except in compliance with the License.
6
# You may obtain a copy of the License at
7
#
8
#     http://www.apache.org/licenses/LICENSE-2.0
9
#
10
# Unless required by applicable law or agreed to in writing, software
11
# distributed under the License is distributed on an "AS IS" BASIS,
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
# See the License for the specific language governing permissions and
14
# limitations under the License.
15

16
"""Models for flare removal."""
17

18
from flare_removal.python import u_net
19
from flare_removal.python import vgg
20

21

22
def build_model(model_type, batch_size):
23
  """Returns a Keras model specified by name."""
24
  if model_type == 'unet':
25
    return u_net.get_model(
26
        input_shape=(512, 512, 3),
27
        scales=4,
28
        bottleneck_depth=1024,
29
        bottleneck_layers=2)
30
  elif model_type == 'can':
31
    return vgg.build_can(
32
        input_shape=(512, 512, 3), conv_channels=64, out_channels=3)
33
  else:
34
    raise ValueError(model_type)
35

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.