Giter Club home page Giter Club logo

ros_numpy's Introduction

ros_numpy

Tools for converting ROS messages to and from numpy arrays. Contains two functions:

  • arr = numpify(msg, ...) - try to get a numpy object from a message
  • msg = msgify(MessageType, arr, ...) - try and convert a numpy object to a message

Currently supports:

  • sensor_msgs.msg.PointCloud2 ↔ structured np.array:

    data = np.zeros(100, dtype=[
      ('x', np.float32),
      ('y', np.float32),
      ('vectors', np.float32, (3,))
    ])
    data['x'] = np.arange(100)
    data['y'] = data['x']*2
    data['vectors'] = np.arange(100)[:,np.newaxis]
    
    msg = ros_numpy.msgify(PointCloud2, data)
    data = ros_numpy.numpify(msg)
    
  • sensor_msgs.msg.Image ↔ 2/3-D np.array, similar to the function of cv_bridge, but without the dependency on cv2

  • nav_msgs.msg.OccupancyGridnp.ma.array

  • geometry.msg.Vector3 ↔ 1-D np.array. hom=True gives [x, y, z, 0]

  • geometry.msg.Point ↔ 1-D np.array. hom=True gives [x, y, z, 1]

  • geometry.msg.Quaternion ↔ 1-D np.array, [x, y, z, w]

  • geometry.msg.Transform ↔ 4×4 np.array, the homogeneous transformation matrix

  • geometry.msg.Pose ↔ 4×4 np.array, the homogeneous transformation matrix from the origin

Support for more types can be added with:

@ros_numpy.converts_to_numpy(SomeMessageClass)
def convert(my_msg):
    return np.array(...)

@ros_numpy.converts_from_numpy(SomeMessageClass)
def convert(my_array):
    return SomeMessageClass(...)

Any extra args or kwargs to numpify or msgify will be forwarded to your conversion function

Future work

  • Add simple conversions for:

    • geometry_msgs.msg.Inertia

ros_numpy's People

Contributors

awesomebytes avatar drsensor avatar eric-wieser avatar gstavrinos avatar mikaelarguedas avatar pedrocorcaque avatar pierrickkoch avatar xaedes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ros_numpy's Issues

Instructions on how to run it?

Hey,

i want to convert a sensor_msgs/PointCloud2 to a numpy array. So I play a bag file or a stream which is publishing the message and then run the python script to convert it? Would be more user-friendly if better instructions were given.

Thank you

Suggestion of sort the offesets in advance in fields_to_type()

I encountered a ValueError in using point_cloud2.pointcloud2_to_xyz_array(). It has been figured out due to the disorder of offest among the PointFields.

The origin message(sensor_msgs/PointCloud2) has 'field' attriubte as below:

name: "x"
offset: 0
datatype: 7
count: 1, name: "y"
offset: 4
datatype: 7
count: 1, name: "z"
offset: 8
datatype: 7
count: 1, name: "intensity"
offset: 32
datatype: 7
count: 1, name: "normal_x"
offset: 16
datatype: 7
count: 1, name: "normal_y"
offset: 20
datatype: 7
count: 1, name: "normal_z"
offset: 24
datatype: 7
count: 1, name: "curvature"
offset: 36
datatype: 7
count: 1

Note that attribute "intensity" with offset 32 is arranged at the front of other attributes with larger offsets. As a result, in pointcloud2_to_array() in point_cloud2.py:

    # construct a numpy record type equivalent to the point type of this cloud
    dtype_list = fields_to_dtype(cloud_msg.fields, cloud_msg.point_step)

    # parse the cloud into an array
    cloud_arr = np.frombuffer(cloud_msg.data, dtype_list)

I got dtype_list in such a strange form:

[('x', dtype('float32')), ('y', dtype('float32')), ('z', dtype('float32')), ('__12', <class 'numpy.uint8'>), ('__13', <class 'numpy.uint8'>), ('__14', <class 'numpy.uint8'>), ('__15', <class 'numpy.uint8'>), ('__16', <class 'numpy.uint8'>), ('__17', <class 'numpy.uint8'>), ('__18', <class 'numpy.uint8'>), ('__19', <class 'numpy.uint8'>), ('__20', <class 'numpy.uint8'>), ('__21', <class 'numpy.uint8'>), ('__22', <class 'numpy.uint8'>), ('__23', <class 'numpy.uint8'>), ('__24', <class 'numpy.uint8'>), ('__25', <class 'numpy.uint8'>), ('__26', <class 'numpy.uint8'>), ('__27', <class 'numpy.uint8'>), ('__28', <class 'numpy.uint8'>), ('__29', <class 'numpy.uint8'>), ('__30', <class 'numpy.uint8'>), ('__31', <class 'numpy.uint8'>), ('intensity', dtype('float32')), ('normal_x', dtype('float32')), ('normal_y', dtype('float32')), ('normal_z', dtype('float32')), ('curvature', dtype('float32'))]

Then it leads to mismatch in data structure and memory space and Error occurs in np.frombuffer()

Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/topics.py", line 750, in _invoke_callback
    cb(msg)
  File "/home/carto/lio_ws/src/faster-lio/src/map_builder.py", line 31, in pc_callback
    self.point_cloud = ros_numpy.point_cloud2.pointcloud2_to_xyz_array(msg)
  File "/home/carto/lio_ws/src/ros_numpy/src/ros_numpy/point_cloud2.py", line 244, in pointcloud2_to_xyz_array
    return get_xyz_points(pointcloud2_to_array(cloud_msg), remove_nans=remove_nans)
  File "/home/carto/lio_ws/src/ros_numpy/src/ros_numpy/point_cloud2.py", line 123, in pointcloud2_to_array
    cloud_arr = np.frombuffer(cloud_msg.data, dtype_list)
ValueError: buffer size must be a multiple of element size

So I wonder whether we can sort the fields in advance in function fields_to_dtype or any other fix to avoid bugs dealing with msg with disorder field.

No corresponding pip installer

I was trying to install this package for use in my python environment. I observed that there are a couple of python packages uploaded to PyPi which are just forks of this repo and they are not well maintained. Such as this.

Can an official pypi package be made for this page to ease installation and also for better maintenance?

TypeError: 'NoneType' object is not iterable

Hi all,
I am trying to convert a ( previously cropped ) 3d array of pixel coordinates to a pointcloud to be published on ROS topic
`
for i in range(len(label_store)):
#create custom message with 3D points of mask
mask_message = Mask_Coordinates()
mask_message.class_name = label_store[i]
mask_message.score = score_store[i]
array_x,array_y,array_z = [],[],[]
score=score_store[i]
for j in range(0,len(path_points[i]))

                array_x.append(array[path_points[i][j][0]][path_points[i][j][1]][0])   
                array_y.append(array[path_points[i][j][0]][path_points[i][j][1]][1])
                array_z.append(array[path_points[i][j][0]][path_points[i][j][1]][2])

        XYZ_array=np.vstack((array_x,array_y,array_z)).T            
        message=rosnp.point_cloud2.array_to_pointcloud2(XYZ_array)

`

I get the following error message

message=rosnp.point_cloud2.array_to_pointcloud2(XYZ_array)
/ros_numpy/point_cloud2.py", line 147, in array_to_pointcloud2
cloud_msg.fields = dtype_to_fields(cloud_arr.dtype)
/ros_numpy/point_cloud2.py", line 92, in dtype_to_fields
for field_name in dtype.names:
TypeError: 'NoneType' object is not iterable

Could you please point me to the errors ?
Thank you
Regards

ROS melodic release?

Hi again, it seems you did not release this package into ROS melodic yet.
Did you just not get around to do it yet or is there a specific reason?
It would be nice to see it available there!

TypeError: numpy_to_image() takes exactly 2 arguments (1 given)

Hi, I am using ros kenetic in Linux 16.04 LTS, and trying to convert numpy array to ros image message. I used the code like:

 img_msg_to_be_publish = ros_numpy.msgify(Image, img_array)

But I get the error:

[ERROR] [1575536397.176668]: bad callback: <bound method Subscriber.callback of <message_filters.Subscriber object at 0x7f03cbe1cbd0>>
Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/topics.py", line 750, in _invoke_callback
    cb(msg)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/message_filters/__init__.py", line 75, in callback
    self.signalMessage(msg)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/message_filters/__init__.py", line 57, in signalMessage
    cb(*(msg + args))
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/message_filters/__init__.py", line 224, in add
    self.signalMessage(*msgs)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/message_filters/__init__.py", line 57, in signalMessage
    cb(*(msg + args))
  File "/home/robot/catkin_ws/src/pose_tracking/scripts/pose_tracker.py", line 87, in callback
    img_msg_to_be_publish = ros_numpy.msgify(Image, processed_img)
  File "/home/robot/catkin_ws/src/ros_numpy/src/ros_numpy/registry.py", line 51, in msgify
    return conv(numpy_obj, *args, **kwargs)
TypeError: numpy_to_image() takes exactly 2 arguments (1 given)

Do I use it in a wrong way? Thank you in advance

PointCloud2 issues/fixes

I identified 2 issues and have two fixes

message = get_a_ros_pointcloud2_message()

# For PointCloud2 topics, there are two issues.
# - the __class__ - mapping is buggy
message.__class__ = sensor_msgs.msg._PointCloud2.PointCloud2
# - the converter assumes the message.field are ordered by the offsets
offset_sorted = {f.offset: f for f in message.fields}
message.fields = [f for (_, f) in sorted(offset_sorted.items())]

ValueError: strides is not compatible with available memory

I am trying to subscribe to a msgfy-ied image and that is leading to a value error.

On the publisher side,

 imgpub = rospy.Publisher("/env_level/labelled_image", Image, queue_size=10)
 imgpub.publish(label_image)
def get_label_image():
        im = pilimg.open("label.png")  # Image from PIL
        label = np.asarray(im)
        print (np.shape(label))
        message = msgify(Image, label, encoding="mono8")
        message.height = np.shape(label)[1]
        message.width = np.shape(label)[0]
        return message

On the subscriber callback,

def lblimg_callback(self, lblimg_data):
      self.label_image = lblimg_data
      im = numpify(self.label_image)

Which leads to the error.

For information, np.intp is int64

confuse readme about trasform numpy to pointcloud2

When I try to transform numpy to pointcloud2, the example on readme file is confusing me:

data = np.zeros(100, dtype=[
  ('x', np.float32),
  ('y', np.float32),
  ('vectors', np.float32, (3,))
])
data['x'] = np.arange(100)
data['y'] = data['x']*2
data['vectors'] = np.arange(100)[:,np.newaxis]

msg = ros_numpy.msgify(PointCloud2, data)

In this example, "x" filed and "y" filed has a size 100, and filed "vectors" has a size 100*3
This makes me thinking that filed "vectors" should put the points I want to transform to ros msg, and "x" filed and "y" filed is the indices of it on the depth image.
This is wrong.
I took some time to realize it. So, to avoid confusion to other users, I propose to update the readme file example as follows:

points = np.random.rand(100,3)  
data = np.zeros(100, dtype=[
  ('x', np.float32),
  ('y', np.float32),
  ('z', np.float32),
])
data['x'] = points[:, 0]
data['y'] = points[:, 1]
data['z'] = points[:, 2]
msg = ros_numpy.msgify(PointCloud2, data)

ros_numpy depends on `numpy < 1.24`

With numpy 1.24 removing np.float alias the following occurs when running the latest numpy version with ros_numpy

AttributeError: module 'numpy' has no attribute 'float'

For the moment, I'm guessing a rollback to 1.23 is required.

ros_numpy broken with numpy 1.24 due to np.float

Issue

With numpy 1.24 np.float is no longer available, thus importing:

from ros_numpy.point_cloud2 import array_to_pointcloud2

breaks due to:

def get_xyz_points(cloud_array, remove_nans=True, dtype=np.float):

with something like:

  File "/opt/ros/noetic/lib/python3/dist-packages/ros_numpy/point_cloud2.py", line 224, in <module>
    def get_xyz_points(cloud_array, remove_nans=True, dtype=np.float):
 <...>/numpy/__init__.py", line 284, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'float'

Suggestion to fix

A simple change to np.float32 should do it.

IndexError: index is out of bounds for axis 0 with size 3

Hello
I have found the following code that assign to a rgb image the related pointcloud of the object detected ( the topic /camera/depth/points) .
I have the error

if math.isnan(array[path_points[i][j][0]][path_points[i][j][1]][0]) or
IndexError: index 124 is out of bounds for axis 0 with size 3

related to the following ros_numpy array

array=rosnp.point_cloud2.pointcloud2_to_xyz_array(self.cloud_msg,False)

Could you please help me to debug ?
Thanks a lot

#!/usr/bin/env python3

import os, sys
import numpy as np
import math
import statistics
import matplotlib.pyplot as plt
from matplotlib.path import Path

import rospy
import ros_numpy as rosnp

from sensor_msgs.msg import PointCloud2
from std_msgs.msg import String

from yolact_ros_msgs.msg import Detections
from yolact_ros_msgs.msg import Detection
from yolact_ros_msgs.msg import Box
from yolact_ros_msgs.msg import Mask
from yolact_ros_msgs.msg import Mask_Depth, Mask_Coordinates

import skimage.data
#Debug printing whole array
np.set_printoptions(threshold=sys.maxsize)

class MaskTo3D(object):

nok_class = ['person','car','bycicle','motorcycle','airplane','bus','train','truck','boat','traffic light','fire hydrant'
            'stop sign','parking meter','sheep','cow','elephant','bear','zebra','giraffe','sheep','horse']
ok_class = []

#change to ros.get_param
depth_topic="/camera/depth/points"



def __init__(self):
    rospy.init_node("depth_mask",anonymous=True)
    mask_msg="/yolact_ros/detections"
    self.pointcloud_sub=rospy.Subscriber("/camera/depth/color/points", PointCloud2, self.pcl_callback)
    self.sub_mask_msg=rospy.Subscriber(mask_msg,Detections,self.mask_msg_callback)
    self.pub_mask_depth=rospy.Publisher("/mask_coordinates", Mask_Depth, queue_size=1)
    self.cloud_msg=PointCloud2()
    self.rate=rospy.Rate(10)
    #fig,self.ax=plt.subplots()
    #plt.show(block=True)


def pcl_callback(self,req):
    #get the data of the PointCloud from RGBD camera
    self.cloud_msg=req

def mask_msg_callback(self,req):
    img=skimage.data.chelsea()
    array=rosnp.point_cloud2.pointcloud2_to_xyz_array(self.cloud_msg,False)
    label_store,score_store,box_store,mask_store,path_points =[],[],[],[],[]

    #custom msg creation with 3D coordinates of each pixel in each masks
    message=Mask_Depth()
    message.header.stamp=rospy.Time.now()

    rospy.loginfo("Parsing detections")
    for item in req.detections:
        label_store.append(item.class_name)
        score_store.append(item.score)
        box_store.append(item.box)
        mask_store.append(item.mask)

    for i in range(len(label_store)):
        #print(box_store[i].x1,box_store[i].x2, box_store[i].y1,box_store[i].y2)
        #Think of retrieving img size from Image topic
        X,Y = np.mgrid[:img.shape[1], :img.shape[0]]
        points = np.vstack((X.ravel(),Y.ravel())).T
        vertices = np.asarray([(box_store[i].x1,box_store[i].y1),
                               (box_store[i].x1,box_store[i].y2),
                               (box_store[i].x2,box_store[i].y1),
                               (box_store[i].x2,box_store[i].y2)])
        path = Path(vertices)        
        mask=path.contains_points(points)
        path_points.append(points[np.where(mask)])
        #print(type(path_points))
        #print(path_points[0][0][0])
        #print(path_points[0][0][1])
        #print(len(label_store),len(score_store),len(box_store),len(mask_store),len(path_points))


    for i in range(len(label_store)):
         #create custom message with 3D points of mask
        mask_message = Mask_Coordinates()
        mask_message.class_name = label_store[i]
        mask_message.score = score_store[i]

        list_x,list_y,list_z = [],[],[]
        score=score_store[i]
        for j in range(0,len(path_points[i])):
        #    print(array[path_points[i][j][0]][path_points[i][j][1]][0])
        #    print(path_points[i][j][0])
        #    print(path_points[i][j][1])
            if math.isnan(array[path_points[i][j][0]][path_points[i][j][1]][0]) or \
               math.isnan(array[path_points[i][j][0]][path_points[i][j][1]][1]) or \
               math.isnan(array[path_points[i][j][0]][path_points[i][j][1]][2]):
                pass
            else:
                list_x.append(array[path_points[i][j][0]][path_points[i][j][1]][0])
                list_y.append(array[path_points[i][j][0]][path_points[i][j][1]][1])
                list_z.append(array[path_points[i][j][0]][path_points[i][j][1]][2])
        
        mask_message.xcoord = list_x
        mask_message.ycoord = list_y
        mask_message.zcoord = list_z
        print(list_z)
    self.pub_mask_depth.publish(message)

if name=="main":
a=MaskTo3D()
while not rospy.is_shutdown():
a.rate.sleep()

Thanks

ROS2 Support

First off, thanks for the nice work on this project. We use it heavily in our analysis stack.

I had looked to see if there was ROS2 support for ros_numpy and could not find it anywhere. To that end, I've forked the repo and ported it so that this package now works with ROS2 Foxy. My working repo is here with the relevant branch being foxy-devel (it should be the default).

All unit tests are passing and I also tested it live against an Ouster LiDAR, ROS2 Foxy, Cyclone DDS, where I was only calling numpify(...) on a PointCloud2 and that seems to be working as well. I will do some deeper checks to further ensure correctness.

There was some effort involved in the port. The big things being:

  • Moving from catkin to ament and making sure it all builds with colcon
  • tf.transformations is not available in ROS2 AFAIK. So, a local copy of transformations.py has been added to the project
  • Some of the msg field constructors in ROS2 were incompatible with the current code base so I ported those too
  • I took the liberty to convert tabs to spaces. I hope that does not offend anyone.

The full diff is here.

All of the above said, if you think the port is acceptable, it would be great to figure out how to best keep the ROS and ROS 2 projects together. I'm open to any suggestions.

transform pointcloud2 to numpy array with shape

Before I use ros, I transform the pointcloud into numpy with shape (720,1280,4). The 4 mean for information: xyz location information and RGB information in one float32 number.

Now I open the camera with ROS. It output the pointcloud by pointcloud2 message. How can I transform the pointcloud2 msg in to the numpy array with shape (720,1280,3)? 3 is the xyz location information.

AttributeError: module 'numpy' has no attribute 'float'

I encounter the following Trackback when using ros_numpy:

Traceback (most recent call last):
  ...
  File "/home/kzheng/repo/robotdev/spot/ros_ws/src/genmos_object_search_ros/src/genmos_ros/ros_utils.py", line 13, in <module>   
    import ros_numpy
  File "/opt/ros/noetic/lib/python3/dist-packages/ros_numpy/__init__.py", line 7, in <module>
    import ros_numpy
  File "/opt/ros/noetic/lib/python3/dist-packages/ros_numpy/__init__.py", line 7, in <module>
    from . import point_cloud2
  File "/opt/ros/noetic/lib/python3/dist-packages/ros_numpy/point_cloud2.py", line 224, in <module>
    from . import point_cloud2
  File "/opt/ros/noetic/lib/python3/dist-packages/ros_numpy/point_cloud2.py", line 224, in <module>
    def get_xyz_points(cloud_array, remove_nans=True, dtype=np.float):
  File "/home/kzheng/repo/robotdev/spot/venv/spot/lib/python3.8/site-packages/numpy/__init__.py", line 305, in __getattr__
    def get_xyz_points(cloud_array, remove_nans=True, dtype=np.float):
  File "/home/kzheng/repo/robotdev/spot/venv/spot/lib/python3.8/site-packages/numpy/__init__.py", line 305, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
    raise AttributeError(__former_attrs__[attr])

According to this Stackoverflow, np.float causes an error with Numpy 1.24+. (I have 1.24.2 installed).

Is this package still being maintained to address this issue?

Can't convert Images from a rosbag

If reading messages from a rosbag one gets an error like:

ValueError: Unable to convert message _sensor_msgs__Image - only supports Numpy_sensor_msgs__Image, Numpy_geometry_msgs__Transform, Numpy_nav_msgs__OccupancyGrid, Numpy_sensor_msgs__PointField[], Transform, PointField[], Image, Numpy_geometry_msgs__Quaternion, OccupancyGrid, PointCloud2, Numpy_geometry_msgs__Point, Pose, Point, Numpy_geometry_msgs__Vector3, Numpy_geometry_msgs__Pose, Numpy_sensor_msgs__PointCloud2, Vector3, Quaternion

That's because

In [1]: from sensor_msgs.msg import Image

In [2]: img = Image()

In [3]: img.__class__
Out[3]: sensor_msgs.msg._Image.Image

In [4]: from rosbag import Bag   

In [5]: b = Bag('poc_bag.bag')

In [6]: r = b.read_messages(topics=['/pepper/camera/depth/image_raw'] )

In [7]: topic, msg, time = r.next()

In [8]: msg.__class__
Out[8]: tmpldS_vh._sensor_msgs__Image

In [13]: img.__class__.__name__
Out[13]: 'Image'

In [14]: msg.__class__.__name__
Out[14]: '_sensor_msgs__Image'

From a rosbag the messages don't seem to have the proper type (I guess it has something to do with the way messages are stored).

PointCloud2 -> np.array with shape=(n_points, point_dimensions)?

Hi there, this is quite a handy package you provide here, thank you!

Currently, I need to convert PointCloud2 data to numpy generating an ndarray with shape=(nr_of_points, 3), that is to say an ndarray with the second dimension having one entry for each geometrical dimension. In general of course the pointcloud could contain more fields.

It looks like the package here converts the PointCloud2 only into a structured ndarray with shape (nr_of_points,) and tuples as entries. Is my requested use-case also supported by the library?

If not, how do you propose to do this conversion efficiently.
Currently, I'm working with

cloud_tmp = ros_numpy.numpify(recognized_object.point_cloud)
cloud_np = np.zeros((cloud_tmp.shape[0], 3), dtype= np.float32)
cloud_np[:,0] = map(lambda x: x[0], cloud_tmp[:])
cloud_np[:,1] = map(lambda x: x[1], cloud_tmp[:])
cloud_np[:,2] = map(lambda x: x[2], cloud_tmp[:])

but that looks rather suboptimal...

Unsupported image encoding [64FC4]

Hi ^^ , i try to display a matrix of my depth map but i have an encoding problem with rviz , i even try with image_view : Unable to convert '64FC4' image for display: 'cv_bridge.cvtColorForDisplay() output encoding is empty and cannot be guessed.'
I use the function : ros_numpy.image.numpy_to_image(maDepth_map,'64FC4') for convert my matrix to image .
I don't know where is the problem and i'm stuck on this error , did i miss something ?

ValueError: Attempted relative import in non-package

Hi,
I wanted to convery numpy array to point cloud.I am facing follwing issue.
I get this error while using this library. Is there any workaround for this?

from .registry import converts_from_numpy, converts_to_numpy

ValueError: Attempted relative import in non-package

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.