TorchYOLOv7KeypointAttribute - Extended-Object-Detection-ROS/wiki_english GitHub Wiki
This attributes uses YOLOv7 keypoint models for object detection. Libtorch is used for detecting and have to be installed.
Modes | Accuracy assessment | 3D-translation | 3D-rotation | Contour extraction | Additional info |
---|---|---|---|---|---|
D | D | ❌ | ❌ | ❌ | <Attribute_name>:class_id, <Attribute_name>:class_label |
Returns areas with objects recognized by YOLOv7 and having a probability not lower than Probability. And also extracts keypoints from it.
Not implemented
Not implemented
- Name (string, must be set) attribute unique name
- Type (string, must be "TorchYOLOv7Kpt") attribute type
- Weight (double, default: 1) attribute weight
- Probability (double, default: 0.75) acceptable detection accuracy, used in Detect mode.
- Contour (bool, default: true) Returns the contour of the attribute if true.
-
model_path (string, must be set) The path to the weight
.pt
file, which must be exported from pytorch (see below). - input_size (int, default: 640) Width and height for CNN input, for most YOLOv7 models is 640.
- labels (list if strings, default: none) if provided adds labels to info and visualization.
- num_class (int, default: 1) Number of classes
- num_points (int, default: 17) Number of keypoints
- force_cuda (int: default: 0) if not 0, tries to run on CUDA (needs proper installation of it)
<?xml version="1.0" ?>
<AttributeLib>
<Attribute Name="torch_kpt" Type="torchyolov7kpt" model_path="/home/anton/Projects/yolov7/yolov7-w6-pose.torchscript.pt" input_size="640" num_class="1" Probability="0.4">
<Filter Type="NMS" threshold="0.5"/>
</Attribute>
</AttributeLib>
<SimpleObjectBase>
<SimpleObject Name="person_keypoints" ID="0" Probability="0.2">
<Attribute Type="Detect">torch_kpt</Attribute>
</SimpleObject>
</SimpleObjectBase>
Use export.py
script from original repository like:
python export.py --weights yolov7-w6-pose.pt --grid
This will create file yolov7-w6-pose.torchscript.pt
that can be used.