开箱即用的计算机视觉
huasca的Python项目详细描述
华沙
计算机视觉模型oob(瓶外)。
__
[__]
___ .+'. '+.
)_( /:;/ _.+'\
+ + +:._ .++
.+'+'+. _ |:._ |
/+::_..+_[_]_+:._CV |
)_ /_ _\:._ |
+;: )_``'_(:._ +
+;::+..+;:.._++.____.+'
`+.._..`+...+'
Huasca通过优先考虑通用性和快速开发而不是精确性来实现原型。
走进酒窖,选择一瓶电脑图像。
- 人脸检测和定位
- 人脸分类
- 年龄
- 性别
- 目标检测和定位
- 目标跟踪
- 不带本地化的对象分类
人脸和对象定位包括方便的裁剪和注释方法,以提供分类器。
路线图
- v0.3.0-减少和组合模型以节省空间
- v0.4.x-添加样式转换
- v0.4.x-人脸识别
示例
检测
检测结果包括:
boxes
:框遵循pil格式(左、上、右、下)- 左上角为(0,0),偏移量从右向下(物理索引)
scores
:每个检测到的对象的置信度得分labels
:对象的标签描述,例如。['dog','person']portraits
:从基本图像中裁剪对象(pil.image格式)base_image
:源图像(pil.image格式)annotated
:带有对象注释的源图像(pil.image格式)
面部和物体检测
# Get a PIL image from somewhere:
image = ...
# Use PIL image as input:
import huasca
faces = huasca.detect.faces(image)
objects = huasca.detect.objects(image)
# Display the first face
faces.portraits[0].show()
# Check classes
print(objects.labels)
# Retrieve annotated & labeled version of either
faces.annotated.show()
objects.annotated.show()
面部人口统计
# Get a PIL image of a face from face detector:
face = faces.portraits[0]
gender,age = huasca.classify.demographics(face)
目标跟踪
import huasca
data = json.load(json_data)
object_log = huasca.object_tracking.track_objects(data)
output_json = [obj.to_json() for obj in object_log]
# Get a PIL image from somewhere:
image = ...
# Use PIL image as input:
import huasca
faces = huasca.detect.faces(image)
objects = huasca.detect.objects(image)
# Display the first face
faces.portraits[0].show()
# Check classes
print(objects.labels)
# Retrieve annotated & labeled version of either
faces.annotated.show()
objects.annotated.show()
# Get a PIL image of a face from face detector:
face = faces.portraits[0]
gender,age = huasca.classify.demographics(face)
目标跟踪
import huasca
data = json.load(json_data)
object_log = huasca.object_tracking.track_objects(data)
output_json = [obj.to_json() for obj in object_log]