首页 文章 精选 留言 我的

精选列表

搜索[JavaScript库],共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,如需转载请自行联系原作者

资源下载

更多资源
腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

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部分的功能。

用户登录
用户注册