Tensorflow 2 的 CenterNet 实现
项目描述
tf-centernet
使用Tensorflow 2 实现 CenterNet。
安装
pip instal tf-centernet
例子
物体检测
import numpy as np
import PIL.Image
import centernet
# Default: num_classes=80
obj = centernet.ObjectDetection(num_classes=80)
# Default: weights_path=None
# num_classes=80 and weights_path=None: Pre-trained COCO model will be loaded.
# Otherwise: User-defined weight file will be loaded.
obj.load_weights(weights_path=None)
img = np.array(PIL.Image.open('./data/sf.jpg'))[..., ::-1]
# The image with predicted bounding-boxes is created if `debug=True`
boxes, classes, scores = obj.predict(img, debug=True)
姿势估计
import numpy as np
import PIL.Image
import centernet
# Default: num_joints=17
pe = centernet.PoseEstimation(num_joints=17)
# Default: weights_path=None
# num_joints=17 and weights_path=None: Pre-trained COCO model will be loaded.
# Otherwise: User-defined weight file will be loaded.
pe.load_weights(weights_path=None)
# Adjust this for the better prediction
pe.score_threshold = 0.1
img = np.array(PIL.Image.open('./data/chi.jpg'))[..., ::-1]
# The image with predicted keypoints is created if `debug=True`
boxes, keypoints, scores = pe.predict(img, debug=True)
去做
- 物体检测
- 使用 Hourglass-104 进行目标检测的预训练模型
- 姿势估计
- 使用 Hourglass-104 进行姿势估计的预训练模型
- DLA-34 主干和预训练模型
- 训练函数和损失定义
- 训练数据增强
项目详情
下载文件
下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。
源分布
tf-centernet-1.0.6.tar.gz
(8.2 kB
查看哈希)
内置分布
tf_centernet-1.0.6-py3-none-any.whl
(19.3 kB
查看哈希)
关
tf_centernet -1.0.6-py3-none-any.whl 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 50180f29181ef0b96f67683d07db5a5fb241f42f306f8bf2a66465e4c2198c22 |
|
| MD5 | 503180c3179b75019bfdab3af9ece504 |
|
| 布莱克2-256 | f553febbe24f1a2e8084d921f6c3996da7a4d0a5296a64f42b25e6ee4cda0c0e |