珀尔宋
purrsong的Python项目详细描述
呼噜声
安装
pip install purrsong
开始
importpurrsongaspsps.__version__>>>0.1.6
创建水蟒环境(可选)
conda create -n purrsong python=3.6conda activate purrsong
要求
- 张量流
- opencv python
- 全面质量管理
- 请求
- 熊猫
自动下载数据集、模型集的提取加载
以下功能自动下载数据或模型并在本地保存 如果数据已经存在,返回数据目录或模型文件名
importpurrsongaspsmodel_list=ps.list_models()# or ps.list_models(fresh=True)print(model_list)ps.load_model('bbs')# or ps.load_model('bbs', fresh=True)dataset_list=ps.list_datasets()# or ps.list_datasets(fresh=True)print(dataset_list)ps.load_dataset('cat')
操作cats数据集
通过下面的示例,您可以使用自动下载的cats
数据集。
尝试更改factor
arg,它将返回不同大小的边界框。
加载cats数据集
importpurrsongaspsimportmatplotlib.pyplotaspltcats=ps.load_cats()
显示CAT图像
img=cats[0]['image']plt.imshow(img)plt.show()
显示带有Landmark的CAT图像
img=cats[0]['image']lmk=cats[0]['landmark']x,y=lmk.Tplt.imshow(img)plt.scatter(x,y)plt.show()
显示猫脸图像
img=cats.face_img(44)# or img = cats.face_img(idx=44, factor=1.7)plt.imshow(img)plt.show()
显示猫左眼图像
img=cats.left_eye_img(44)# or img = cats.face_img(idx=44, factor=1.7)plt.imshow(img)plt.show()
可用的数据功能
importpurrsongaspscats=ps.load_cats()cat=cats(0)# or cats(idx=0, factor=1.7)cat['image']# cats.image(0)cat['landmark']# cats.landmark(0)cat['face']# cats.face(0, factor=1.7)cat['face_bb']# cats.face_bb(0, factor=1.7)cat['face_img']# cats.face_img(0, factor=1.7)cat['face_lmk']# cats.face_lmk(0, factor=1.7)cat['eye']# cats.eye(0, factor=1.7)cat['left_eye_bb']# cats.left_eye_bb(0, factor=1.7)cat['left_eye_img']# cats.left_eye_img(0, factor=1.7)cat['right_eye_bb']# cats.right_eye_bb(0, factor=1.7)cat['right_eye_img']# cats.right_eye_img(0, factor=1.7)cat['nose']# cats.nose(0, factor=1.7)cat['nose_bb']# cats.nose_bb(0, factor=1.7)cat['nose_img']# cats.nose_img(0, factor=1.7)cat['ear']# cats.ear(0, factor=1.7)cat['left_ear_bb']# cats.left_ear_bb(0, factor=1.7)cat['left_ear_img']# cats.left_ear_img(0, factor=1.7)cat['right_ear_bb']# cats.right_ear_bb(0, factor=1.7)cat['right_ear_img']# cats.right_ear_img(0, factor=1.7)
img=cats[0]['image']plt.imshow(img)plt.show()
显示带有Landmark的CAT图像
img=cats[0]['image']lmk=cats[0]['landmark']x,y=lmk.Tplt.imshow(img)plt.scatter(x,y)plt.show()
显示猫脸图像
img=cats.face_img(44)# or img = cats.face_img(idx=44, factor=1.7)plt.imshow(img)plt.show()
显示猫左眼图像
img=cats.left_eye_img(44)# or img = cats.face_img(idx=44, factor=1.7)plt.imshow(img)plt.show()
可用的数据功能
importpurrsongaspscats=ps.load_cats()cat=cats(0)# or cats(idx=0, factor=1.7)cat['image']# cats.image(0)cat['landmark']# cats.landmark(0)cat['face']# cats.face(0, factor=1.7)cat['face_bb']# cats.face_bb(0, factor=1.7)cat['face_img']# cats.face_img(0, factor=1.7)cat['face_lmk']# cats.face_lmk(0, factor=1.7)cat['eye']# cats.eye(0, factor=1.7)cat['left_eye_bb']# cats.left_eye_bb(0, factor=1.7)cat['left_eye_img']# cats.left_eye_img(0, factor=1.7)cat['right_eye_bb']# cats.right_eye_bb(0, factor=1.7)cat['right_eye_img']# cats.right_eye_img(0, factor=1.7)cat['nose']# cats.nose(0, factor=1.7)cat['nose_bb']# cats.nose_bb(0, factor=1.7)cat['nose_img']# cats.nose_img(0, factor=1.7)cat['ear']# cats.ear(0, factor=1.7)cat['left_ear_bb']# cats.left_ear_bb(0, factor=1.7)cat['left_ear_img']# cats.left_ear_img(0, factor=1.7)cat['right_ear_bb']# cats.right_ear_bb(0, factor=1.7)cat['right_ear_img']# cats.right_ear_img(0, factor=1.7)
img=cats.face_img(44)# or img = cats.face_img(idx=44, factor=1.7)plt.imshow(img)plt.show()
显示猫左眼图像
img=cats.left_eye_img(44)# or img = cats.face_img(idx=44, factor=1.7)plt.imshow(img)plt.show()
可用的数据功能
importpurrsongaspscats=ps.load_cats()cat=cats(0)# or cats(idx=0, factor=1.7)cat['image']# cats.image(0)cat['landmark']# cats.landmark(0)cat['face']# cats.face(0, factor=1.7)cat['face_bb']# cats.face_bb(0, factor=1.7)cat['face_img']# cats.face_img(0, factor=1.7)cat['face_lmk']# cats.face_lmk(0, factor=1.7)cat['eye']# cats.eye(0, factor=1.7)cat['left_eye_bb']# cats.left_eye_bb(0, factor=1.7)cat['left_eye_img']# cats.left_eye_img(0, factor=1.7)cat['right_eye_bb']# cats.right_eye_bb(0, factor=1.7)cat['right_eye_img']# cats.right_eye_img(0, factor=1.7)cat['nose']# cats.nose(0, factor=1.7)cat['nose_bb']# cats.nose_bb(0, factor=1.7)cat['nose_img']# cats.nose_img(0, factor=1.7)cat['ear']# cats.ear(0, factor=1.7)cat['left_ear_bb']# cats.left_ear_bb(0, factor=1.7)cat['left_ear_img']# cats.left_ear_img(0, factor=1.7)cat['right_ear_bb']# cats.right_ear_bb(0, factor=1.7)cat['right_ear_img']# cats.right_ear_img(0, factor=1.7)
importpurrsongaspscats=ps.load_cats()cat=cats(0)# or cats(idx=0, factor=1.7)cat['image']# cats.image(0)cat['landmark']# cats.landmark(0)cat['face']# cats.face(0, factor=1.7)cat['face_bb']# cats.face_bb(0, factor=1.7)cat['face_img']# cats.face_img(0, factor=1.7)cat['face_lmk']# cats.face_lmk(0, factor=1.7)cat['eye']# cats.eye(0, factor=1.7)cat['left_eye_bb']# cats.left_eye_bb(0, factor=1.7)cat['left_eye_img']# cats.left_eye_img(0, factor=1.7)cat['right_eye_bb']# cats.right_eye_bb(0, factor=1.7)cat['right_eye_img']# cats.right_eye_img(0, factor=1.7)cat['nose']# cats.nose(0, factor=1.7)cat['nose_bb']# cats.nose_bb(0, factor=1.7)cat['nose_img']# cats.nose_img(0, factor=1.7)cat['ear']# cats.ear(0, factor=1.7)cat['left_ear_bb']# cats.left_ear_bb(0, factor=1.7)cat['left_ear_img']# cats.left_ear_img(0, factor=1.7)cat['right_ear_bb']# cats.right_ear_bb(0, factor=1.7)cat['right_ear_img']# cats.right_ear_img(0, factor=1.7)
左听写形式更直观,更好 当您必须同时处理许多功能时。 当您访问特定的数据类型时,正确的方法方式是很好的。