91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 961KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-23
  • 語言: 其他
  • 標簽: tensorflow??

資源簡介

下載深度學習的VGG19網絡參數,有下載地址,VGG19網絡參數參數下載放在指定的位置,即可運行

資源截圖

代碼片段和文件信息

import?tensorflow?as?tf
import?numpy?as?np
import?utils
import?vgg19
import?style_transfer
import?os

import?argparse

“““parsing?and?configuration“““
def?parse_args():
????desc?=?“Tensorflow?implementation?of?‘Image?style?Transfer?Using?Convolutional?Neural?Networks“
????parser?=?argparse.ArgumentParser(description=desc)

????parser.add_argument(‘--model_path‘?type=str?default=‘pre_trained_model‘?help=‘The?directory?where?the?pre-trained?model?was?saved‘)
????parser.add_argument(‘--content‘?type=str?default=‘images/a12345.jpg‘?help=‘File?path?of?content?image?(notation?in?the?paper?:?p)‘)
????parser.add_argument(‘--style‘?type=str?default=‘images/kandinsky.jpg‘?help=‘File?path?of?style?image?(notation?in?the?paper?:?a)‘)
????parser.add_argument(‘--output‘?type=str?default=‘result_a12345_kandinsky.jpg‘?help=‘File?path?of?output?image‘)

????parser.add_argument(‘--loss_ratio‘?type=float?default=1e-3?help=‘Weight?of?content-loss?relative?to?style-loss‘)

????parser.add_argument(‘--content_layers‘?nargs=‘+‘?type=str?default=[‘conv4_2‘]?help=‘VGG19?layers?used?for?content?loss‘)
????parser.add_argument(‘--style_layers‘?nargs=‘+‘?type=str?default=[‘relu1_1‘?‘relu2_1‘?‘relu3_1‘?‘relu4_1‘?‘relu5_1‘]
????????????????????????help=‘VGG19?layers?used?for?style?loss‘)

????parser.add_argument(‘--content_layer_weights‘?nargs=‘+‘?type=float?default=[1.0]?help=‘Content?loss?for?each?content?is?multiplied?by?corresponding?weight‘)
????parser.add_argument(‘--style_layer_weights‘?nargs=‘+‘?type=float?default=[.2.2.2.2.2]
????????????????????????help=‘style?loss?for?each?content?is?multiplied?by?corresponding?weight‘)

????parser.add_argument(‘--initial_type‘?type=str?default=‘content‘?choices=[‘random‘‘content‘‘style‘]?help=‘The?initial?image?for?optimization?(notation?in?the?paper?:?x)‘)
????parser.add_argument(‘--max_size‘?type=int?default=512?help=‘The?maximum?width?or?height?of?input?images‘)
????parser.add_argument(‘--content_loss_norm_type‘?type=int?default=3?choices=[123]?help=‘Different?types?of?normalization?for?content?loss‘)
????parser.add_argument(‘--num_iter‘?type=int?default=1000?help=‘The?number?of?iterations?to?run‘)

????return?check_args(parser.parse_args())

“““checking?arguments“““
def?check_args(args):
????try:
????????assert?len(args.content_layers)?==?len(args.content_layer_weights)
????except:
????????print?(‘content?layer?info?and?weight?info?must?be?matched‘)
????????return?None
????try:
????????assert?len(args.style_layers)?==?len(args.style_layer_weights)
????except:
????????print(‘style?layer?info?and?weight?info?must?be?matched‘)
????????return?None

????try:
????????assert?args.max_size?>?100
????except:
????????print?(‘Too?small?size‘)
????????return?None

????try:
????????assert?os.path.exists(args.content)
????except:
????????print(‘There?is?no?%s‘%args.content)
????????return?None

????try:
????????assert?os.path.exists(args.style)
????except:
????????print(‘There?is?no?%s

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件????????185??2018-09-27?12:47??tensorflow-style\.idea\misc.xml

?????文件????????324??2018-09-27?11:32??tensorflow-style\.idea\modules.xml

?????文件????????459??2018-09-27?11:36??tensorflow-style\.idea\tensorflow-style-transfer-hwalsuklee.iml

?????文件??????11111??2018-09-27?14:00??tensorflow-style\.idea\workspace.xml

?????文件?????202426??2017-02-17?09:12??tensorflow-style\images\kandinsky.jpg

?????文件?????101993??2017-02-17?09:12??tensorflow-style\images\seated-nude.jpg

?????文件?????144730??2017-02-17?09:12??tensorflow-style\images\shipwreck.jpg

?????文件?????205803??2017-02-17?09:12??tensorflow-style\images\starry-night.jpg

?????文件?????216723??2017-02-17?09:12??tensorflow-style\images\the_scream.jpg

?????文件?????101689??2017-02-17?09:12??tensorflow-style\images\woman-with-hat-matisse.jpg

?????文件???????5955??2017-02-17?09:12??tensorflow-style\README.md

?????文件???????5922??2018-09-27?14:00??tensorflow-style\run_main.py

?????文件???????5787??2017-02-17?09:12??tensorflow-style\style_transfer.py

?????文件???????2816??2017-02-17?09:12??tensorflow-style\utils.py

?????文件???????2567??2018-09-27?11:54??tensorflow-style\vgg19.py

?????文件?????????75??2018-09-27?14:15??tensorflow-style\vgg19_param\下載vgg19的深度訓練的數據,下載在此處.txt

?????文件???????3758??2018-09-27?12:51??tensorflow-style\__pycache__\style_transfer.cpython-35.pyc

?????文件???????1604??2018-09-27?12:51??tensorflow-style\__pycache__\utils.cpython-35.pyc

?????文件???????2964??2018-09-27?12:51??tensorflow-style\__pycache__\vgg19.cpython-35.pyc

?????目錄??????????0??2018-09-27?14:00??tensorflow-style\.idea

?????目錄??????????0??2018-09-27?13:54??tensorflow-style\images

?????目錄??????????0??2018-09-27?12:49??tensorflow-style\samples

?????目錄??????????0??2018-09-27?14:55??tensorflow-style\vgg19_param

?????目錄??????????0??2018-09-27?13:47??tensorflow-style\__pycache__

?????目錄??????????0??2018-09-27?14:00??tensorflow-style

-----------?---------??----------?-----??----

??????????????1016891????????????????????25


評論

共有 條評論