Update Ruff formatting actions (#13787)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
f22d2d9546
commit
a97bb41008
3 changed files with 6 additions and 4 deletions
|
|
@ -105,17 +105,18 @@ The `sensor_msgs/Image` [message type](https://docs.ros.org/en/api/sensor_msgs/h
|
|||
|
||||
```python
|
||||
def callback(data):
|
||||
"""Callback function to process image and publish annotated images."""
|
||||
"""Callback function to process image and publish annotated images."""
|
||||
array = ros_numpy.numpify(data)
|
||||
if det_image_pub.get_num_connections():
|
||||
det_result = detection_model(array)
|
||||
det_annotated = det_result[0].plot(show=False)
|
||||
det_image_pub.publish(ros_numpy.msgify(Image, det_annotated, encoding='rgb8'))
|
||||
det_image_pub.publish(ros_numpy.msgify(Image, det_annotated, encoding="rgb8"))
|
||||
|
||||
if seg_image_pub.get_num_connections():
|
||||
seg_result = segmentation_model(array)
|
||||
seg_annotated = seg_result[0].plot(show=False)
|
||||
seg_image_pub.publish(ros_numpy.msgify(Image, seg_annotated, encoding='rgb8'))
|
||||
seg_image_pub.publish(ros_numpy.msgify(Image, seg_annotated, encoding="rgb8"))
|
||||
|
||||
|
||||
rospy.Subscriber("/camera/color/image_raw", Image, callback)
|
||||
|
||||
|
|
|
|||
|
|
@ -149,7 +149,6 @@ markers = [
|
|||
]
|
||||
norecursedirs = [".git", "dist", "build"]
|
||||
|
||||
|
||||
[tool.coverage.run]
|
||||
source = ["ultralytics/"]
|
||||
data_file = "tests/.coverage"
|
||||
|
|
|
|||
|
|
@ -38,10 +38,12 @@ try:
|
|||
except (ImportError, AssertionError):
|
||||
mlflow = None
|
||||
|
||||
|
||||
def sanitize_dict(x):
|
||||
"""Sanitize dictionary keys by removing parentheses and converting values to floats."""
|
||||
return {k.replace("(", "").replace(")", ""): float(v) for k, v in x.items()}
|
||||
|
||||
|
||||
def on_pretrain_routine_end(trainer):
|
||||
"""
|
||||
Log training parameters to MLflow at the end of the pretraining routine.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue