Giter VIP home page Giter VIP logo

Comments (7)

mgonzs13 avatar mgonzs13 commented on July 20, 2024

That's a bit strange. Can you check the image messages published in the image topic with ros2 echo?

from yolov8_ros.

GeraltRivskiy avatar GeraltRivskiy commented on July 20, 2024

It looks like this:

header:
stamp:
sec: 0
nanosec: 0
frame_id: ''
height: 320
width: 320
encoding: bgr8
is_bigendian: 0
step: 0
data:

  • 103
  • 120
  • 140
  • 255
  • 103
  • 120
  • there is a lot of similar lines with int8
  • 255
  • '...'

from yolov8_ros.

GeraltRivskiy avatar GeraltRivskiy commented on July 20, 2024

I edited source code of your package by edit some parameters in model.predict: augment=False and imgsz=(320,320) so it wont transform images, but it still do

from yolov8_ros.

mgonzs13 avatar mgonzs13 commented on July 20, 2024

You should fill all the fields of the messages, I mean the frame_id, the stamp and the step.

from yolov8_ros.

GeraltRivskiy avatar GeraltRivskiy commented on July 20, 2024

Frame_id and stamp is not fillable according to ros docs
I tried to fill step, but I dont actually get what it needs
In docs it described as "Full row length in bytes", and I tried to use len() or sizeof() functions on image (that I get by self.__cam.getImage()), but its not working
[yolov8_node-1] File "/opt/ros/humble/local/lib/python3.10/dist-packages/cv_bridge/core.py", line 180, in imgmsg_to_cv2 [yolov8_node-1] im = np.ndarray(shape=(img_msg.height, int(img_msg.step/dtype.itemsize/n_channels), n_channels), [yolov8_node-1] TypeError: buffer is too small for requested array

from yolov8_ros.

mgonzs13 avatar mgonzs13 commented on July 20, 2024

Why are they not fillable? As you are publishing your own image messages, you should fill it with the acquisition time and the optical frame of your simulated camera. This is important for the 3D version, which uses message synchronization and the tf.

Anyway, the step is the full row length in bytes, that is the Image Width * Bytes per Pixel. In your case, the width is 320 and the bytes per pixel are obtained from the encoding type, that is BGR8 (3 bytes per pixel). So your step is 960 bytes.

from yolov8_ros.

GeraltRivskiy avatar GeraltRivskiy commented on July 20, 2024

Thanks a lot!
It works fine for me with step, thanks for explanation, I got that stamp and id should be filled via std_msgs/Header, but it worked without it, so I decided to continue my work without it
It has issues with objects I detect, all of them has the same class_name, its strange because I tested model separately and it worked fine. But its not about issue I started, thanks a lot for your help!

from yolov8_ros.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.