首页 文章 精选 留言 我的

精选列表

搜索[向量库],共10000篇文章
优秀的个人博客,低调大师

Python数据增强(data augmentation)库--Augmentor 使用介绍

Augmentor 使用介绍 原图 1.random_distortion(probability, grid_height, grid_width, magnitude) 最终选择参数为 p.random_distortion(probability=0.8, grid_height=3, grid_width=3, magnitude=6) 其他参数效果: magnitude和grid_width,grid_height越大,扭曲程度越大 p.random_distortion(probability=0.6, grid_height=6, grid_width=6, magnitude=5) p.random_distortion(probability=0.6, grid_height=6, grid_width=6, magnitude=9) p.random_distortion(probability=0.6, grid_height=10, grid_width=10, magnitude=5) 2.random_erasing(probability, rectangle_area) rectangle_area表示覆盖区域的比例,值越大比例越大。但是设置为1的时候并不是全覆盖,不知道为什么,反正也没必要弄清楚 p.random_erasing(1,1) 3.zoom_random(probability, percentage_area) 放大图片,然后按照percenta_area的比例对图片进行crop。 p.zoom_random(probability=1, percentage_area=0.2) p.zoom_random(probability=1, percentage_area=0.8) 4.zoom(probability, min_factor, max_factor) p.zoom(probability=1, min_factor=1.1, max_factor=1.5) p.zoom(probability=1, min_factor=2, max_factor=2) 组合操作 p.rotate_random_90(probability=0.8) p.random_distortion(probability=0.8, grid_height=3, grid_width=3, magnitude=6) p.random_erasing(0.3, 0.2) p.zoom(probability=0.4, min_factor=1.1, max_factor=1.5) p.sample(6) MARSGGBO原创 2018-4-1

优秀的个人博客,低调大师

python标准库学习5 ---bisect — Array bisection algorithm

#coding=utf-8 import bisect list = [ 1 , 2 , 3 , 4 , 6 , 7 , 8 , 9 ] #假定list已经排序 print bisect.bisect_left( list , 5 ) #返回5应该插入的索引位置 print bisect.bisect_right( list , 5 ) print bisect.bisect( list , 5 ) bisect.insort_left( list , 5 , 0 , len ( list )) print list bisect.insort_right( list , 5 ) print list def index(a, x): 'Locate the leftmost value exactly equal to x' i = bisect_left(a, x) if i ! = len (a) and a[i] = = x: return i raise ValueError def find_lt(a, x): 'Find rightmost value less than x' i = bisect_left(a, x) if i: return a[i - 1 ] raise ValueError def find_le(a, x): 'Find rightmost value less than or equal to x' i = bisect_right(a, x) if i: return a[i - 1 ] raise ValueError def find_gt(a, x): 'Find leftmost value greater than x' i = bisect_right(a, x) if i ! = len (a): return a[i] raise ValueError def find_ge(a, x): 'Find leftmost item greater than or equal to x' i = bisect_left(a, x) if i ! = len (a): return a[i] raise ValueError >>> def grade(score, breakpoints = [ 60 , 70 , 80 , 90 ], grades = 'FDCBA' ): ... i = bisect(breakpoints, score) ... return grades[i] ... >>> [grade(score) for score in [ 33 , 99 , 77 , 70 , 89 , 90 , 100 ]] [ 'F' , 'A' , 'C' , 'C' , 'B' , 'A' , 'A' ] >>> data = [( 'red' , 5 ), ( 'blue' , 1 ), ( 'yellow' , 8 ), ( 'black' , 0 )] >>> data.sort(key = lambda r: r[ 1 ]) >>> keys = [r[ 1 ] for r in data] # precomputed list of keys >>> data[bisect_left(keys, 0 )] ( 'black' , 0 ) >>> data[bisect_left(keys, 1 )] ( 'blue' , 1 ) >>> data[bisect_left(keys, 5 )] ( 'red' , 5 ) >>> data[bisect_left(keys, 8 )] ( 'yellow' , 8 ) ============================================================================== 本文转自被遗忘的博客园博客,原文链接:http://www.cnblogs.com/rollenholt/archive/2011/11/26/2264244.html,如需转载请自行联系原作者

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册