From commits-return-2303-archive-asf-public=cust-asf.ponee.io@singa.incubator.apache.org Fri Jun 8 17:29:09 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 347841807A1 for ; Fri, 8 Jun 2018 17:29:05 +0200 (CEST) Received: (qmail 62164 invoked by uid 500); 8 Jun 2018 15:29:05 -0000 Mailing-List: contact commits-help@singa.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@singa.incubator.apache.org Delivered-To: mailing list commits@singa.incubator.apache.org Received: (qmail 62119 invoked by uid 99); 8 Jun 2018 15:29:05 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jun 2018 15:29:05 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id C86193A0565 for ; Fri, 8 Jun 2018 15:29:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1833193 [9/17] - in /incubator/singa/site/trunk: en/ en/_sources/ en/_sources/develop/ en/_sources/docs/ en/_sources/docs/model_zoo/examples/imagenet/densenet/ en/_sources/docs/model_zoo/examples/imagenet/vgg/ en/_sources/releases/ en/comm... Date: Fri, 08 Jun 2018 15:29:02 -0000 To: commits@singa.apache.org From: wangwei@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20180608152903.C86193A0565@svn01-us-west.apache.org> Added: incubator/singa/site/trunk/zh/docs/image_tool.html URL: http://svn.apache.org/viewvc/incubator/singa/site/trunk/zh/docs/image_tool.html?rev=1833193&view=auto ============================================================================== --- incubator/singa/site/trunk/zh/docs/image_tool.html (added) +++ incubator/singa/site/trunk/zh/docs/image_tool.html Fri Jun 8 15:29:00 2018 @@ -0,0 +1,502 @@ + + + + + + + + + + + + 图像工具 — incubator-singa 1.1.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ +
    + +
  • Docs »
  • + +
  • 文档 »
  • + +
  • 图像工具
  • + + +
  • + + + +
  • + +
+ + +
+
+
+
+ +
+

图像工具¶

+

图像增强的模型。

+

示例用法:

+
from singa import image_tool
+
+tool = image_tool.ImageTool()
+imgs = tool.load('input.png').resize_by_list([112]).crop5((96, 96), 5).enhance().flip().get()
+for idx, img in enumerate(imgs):
+    img.save('%d.png' % idx)
+
+
+
+
+

class singa.image_tool.ImageTool¶

+

一个图像增强工具。 对于inplace = True的操作,返回的值是ImageTool实例,用于链接多个操作; 否则,将返回预处理过的图像。 对于具有可数预处理情况的操作,可以设置参数num_case来决定要应用的预处理情况的数量。 通常,训练阶段设置为1,测试阶段设置为最大。

+
+
+

color_cast(offset=20, inplace=True)¶

+

对每个通道加上一个随机偏移值[-offset, offset]。

+

参数:

+
    +
  • offset – 偏移, >0 and <255
  • +
  • inplace – 对原图对象操作或返回一张新图
  • +
+
+
+
+

crop3(patch, num_case=1, inplace=True)¶

+

对给定位置,截取可能的最大方框并缩放到给定尺寸。 按照图像尺寸,截取位置可以是(左, 中, 右)或(上, 中, 下)之一。

+

参数:

+
    +
  • patch (tuple) – 输出图像的高和宽
  • +
  • num_case – 情况数目, 必须在[1,3]
  • +
  • inplace – 对原图对象操作或返回一张新图
  • +
+
+
+
+

crop5(patch, num_case=1, inplace=True)¶

+

截取位置可以是[左上, 左下, 右上, 右下, 中间]。

+

参数:

+
    +
  • patch (tuple) – 输出图像的高和宽
  • +
  • num_case – 情况数目, 必须在[1,5]
  • +
  • inplace – 对原图对象操作或返回一张新图
  • +
+
+
+
+

crop8(patch, num_case=1, inplace=True)¶

+

这是patch_5和patch_and_scale的并集。 你可以依照这个例子取任何情况的并集。

+
+
+
+

enhance(scale=0.2, inplace=True)¶

+

对色度、对比度、亮度和锐度采用随机增强。

+

参数:

+
    +
  • scale (float) – 增强范围 [1-scale, 1+scale]
  • +
  • inplace – 对原图对象操作或返回一张新图
  • +
+
+
+
+

flip(num_case=1, inplace=True)¶

+

随机向左或向右翻转图像。

+

参数:

+
    +
  • num_case – 情况数目,必须是 {1,2}; 如果是2,则会返回原图以及翻转的图像。
  • +
  • inplace – 对原图对象操作或返回一张新图
  • +
+
+
+
+

num_augmentation()¶

+

返回每张图像被增强后的总数

+
+
+
+

random_crop(patch, inplace=True)¶

+

根据随机偏移截取指定大小的图像

+

参数:

+
    +
  • patch (tuple) – 截取图像块的高和宽
  • +
  • inplace (Boolean) – 如果为真,直接用新图像块替换原始图像内容;否则返回新图像块。
  • +
+
+
+
+

resize_by_list(size_list, num_case=1, inplace=True)¶

+

参数:

+
    +
  • num_case – 缩放操作数目, 必须不超过size_list的长度
  • +
  • inplace – 对原图对象操作或返回一张新图
  • +
+
+
+
+

resize_by_range(rng, inplace=True)¶

+

参数:

+
    +
  • rng – 元组 (起始值, 结束值), 包括起始值但不包括结束值
  • +
  • inplace – 对原图对象操作或返回一张新图
  • +
+
+
+
+

rotate_by_list(angle_list, num_case=1, inplace=True)¶

+

参数:

+
    +
  • num_case – 旋转操作数目, 必须不超过angle_list的长度
  • +
  • inplace – 对原图对象操作或返回一张新图
  • +
+
+
+
+

rotate_by_range(rng, inplace=True)¶

+

参数:

+
    +
  • rng – 表示旋转角度范围的元组 (起始值, 结束值), 包括起始值但不包括结束值
  • +
  • inplace – 对原图对象操作或返回一张新图
  • +
+
+
+
+

singa.image_tool.color_cast(img, offset)¶

+

对每个通道加上一个随机偏移值[-offset, offset]。

+
+
+
+

singa.image_tool.crop(img, patch, position)¶

+

截取给定位置和给定大小的图像块。

+

参数:

+
    +
  • patch (tuple) – 宽,高
  • +
  • position (list(str)) – 左上,左下,右上,右下,中间
  • +
+
+
+
+

singa.image_tool.crop_and_resize(img, patch, position)¶

+

对给定位置,截取可能的最大方框并缩放到给定尺寸。

+

参数:

+
    +
  • patch (tuple) – 宽,高
  • +
  • position (list(str)) – 左,中,右,上,中,下
  • +
+
+
+
+

singa.image_tool.enhance(img, scale)¶

+

对色度、对比度、亮度和锐度采用随机增强。

+

参数:

+
    +
  • scale (float) – 增强范围 [1-scale, 1+scale]
  • +
+
+
+
+

singa.image_tool.load_img(path, grayscale=False)¶

+

从给定路径读取图像。

+
+
+
+

singa.image_tool.resize(img, small_size)¶

+

缩放图像使得最短边达到给定大小。

+
+
+
+
+ + +
+ +
+
+ + + + +
+ +
+

+ © Copyright 2018 The Apache Software Foundation. All rights reserved. Apache SINGA, Apache, the Apache feather logo, and the Apache SINGA project logos are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.. + +

+
+ Built with Sphinx using a theme provided by Read the Docs. + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + +
+ + incubator-singa + v: latest + + +
+
+
Languages
+
English
+
中文
+
+
+
Versions
+
0.3
+
1.1
+
+ +
+ + + + + + + + + + +
+ + + Fork me on GitHub + + + + + + + \ No newline at end of file Added: incubator/singa/site/trunk/zh/docs/index.html URL: http://svn.apache.org/viewvc/incubator/singa/site/trunk/zh/docs/index.html?rev=1833193&view=auto ============================================================================== --- incubator/singa/site/trunk/zh/docs/index.html (added) +++ incubator/singa/site/trunk/zh/docs/index.html Fri Jun 8 15:29:00 2018 @@ -0,0 +1,672 @@ + + + + + + + + + + + + 文档 — incubator-singa 1.1.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ +
    + +
  • Docs »
  • + +
  • 文档
  • + + +
  • + + + +
  • + +
+ + +
+
+
+
+ +
+

文档¶

+
+ +
+
+ + +
+ +
+
+ + + + +
+ +
+

+ © Copyright 2018 The Apache Software Foundation. All rights reserved. Apache SINGA, Apache, the Apache feather logo, and the Apache SINGA project logos are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.. + +

+
+ Built with Sphinx using a theme provided by Read the Docs. + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + +
+ + incubator-singa + v: latest + + +
+
+
Languages
+
English
+
中文
+
+
+
Versions
+
0.3
+
1.1
+
+ +
+ + + + + + + + + + +
+ + + Fork me on GitHub + + + + + + + \ No newline at end of file