Python Wrapper for Embree

Related tags

Deep Learningpyembree
Overview

pyembree

Python Wrapper for Embree

Installation

You can install pyembree (and embree) via the conda-forge package.

$ conda install -c conda-forge pyembree

Suppressing errors

Creating multiple scenes produces some harmless error messages:

ERROR CAUGHT IN EMBREE
ERROR: Invalid operation
ERROR MESSAGE: b'already initialized'

These can be suppressed with:

import logging
logging.getLogger('pyembree').disabled = True
Comments
  • Enhancement PR

    Enhancement PR

    This PR does the following things

    • Performed typo refactoring in pyx files
    • Updated to newer Embree API (2.) . Embree 3.0 is being developed...
    • Added the possibility to export all embree results when performing request
    • Added 12 new tests run from nosetests, activated them in travis
    • Run examples in travis

    One can discuss each point...

    opened by Gjacquenot 10
  • install info

    install info

    Hi,

    Thanks for making this git. Could you give some more details on how to install Pyembree?

    In Ubuntu command line, I insert sudo python setup.py install

    But there is some missing folder embree2 appartently... Or do I first have to install and compile embree itself?

    Best regards, Arne

    opened by avlonder 4
  • Fixed an attribute in trianges.pyx that prevents compilation

    Fixed an attribute in trianges.pyx that prevents compilation

    I have updated a trianges.pyx since it is using a missing attribute.

    I guess one wants RTC_GEOMETRY_STATIC instead of RTCGEOMETRY_STATIC.

    https://github.com/embree/embree/blob/90e49f243703877c7714814d6eaa5aa3422a5839/include/embree2/rtcore_geometry.h#L72

    The original error log is presented here

    D:\Embree\pyembree>python setup.py build
    Please put "# distutils: language=c++" in your .pyx or .pxd file(s)
    Compiling pyembree\trianges.pyx because it changed.
    [1/1] Cythonizing pyembree\trianges.pyx
    
    Error compiling Cython file:
    ------------------------------------------------------------
    ...
    def run_triangles():
        pass
    
    cdef unsigned int addCube(rtcs.RTCScene scene_i):
        cdef unsigned int mesh = rtcg.rtcNewTriangleMesh(scene_i,
                    rtcg.RTCGEOMETRY_STATIC, 12, 8, 1)
                       ^
    ------------------------------------------------------------
    
    pyembree\trianges.pyx:19:20: cimported module has no attribute 'RTCGEOMETRY_STATIC'
    Traceback (most recent call last):
      File "setup.py", line 11, in <module>
        include_path=include_path)
      File "C:\Program Files\Python36\lib\site-packages\Cython\Build\Dependencies.py", line 1039, in cythonize
        cythonize_one(*args)
      File "C:\Program Files\Python36\lib\site-packages\Cython\Build\Dependencies.py", line 1161, in cythonize_one
        raise CompileError(None, pyx_file)
    Cython.Compiler.Errors.CompileError: pyembree\trianges.pyx
    
    opened by Gjacquenot 3
  • Building Pyembree for use in AWS Lambda

    Building Pyembree for use in AWS Lambda

    I'd like to run Pyembree in an AWS Lambda function (via a Lambda 'Layer'), which means Embree will be located in /opt/python/embree. I'm having a bit of trouble configuring Pyembree to expect Embree in this location.

    This is what I've tried so far (cobbled together from this script and this comment) to build the environment:

    sudo amazon-linux-extras install python3.8
    sudo yum install python38-devel gcc gcc-c++
    wget https://github.com/embree/embree/releases/download/v2.17.7/embree-2.17.7.x86_64.linux.tar.gz -O /tmp/embree.tar.gz -nv
    sudo mkdir /opt/python/embree
    sudo tar -xzf /tmp/embree.tar.gz --strip-components=1 -C /opt/python/embree
    sudo pip3.8 install --no-cache-dir numpy cython
    wget https://github.com/scopatz/pyembree/releases/download/0.1.6/pyembree-0.1.6.tar.gz
    tar xf pyembree-0.1.6.tar.gz
    sed -i -e 's/embree2/\/opt\/python\/embree\/include\/embree2/g' pyembree-0.1.6/pyembree/*
    tar czf pyembree-0.1.6.tar.gz pyembree-0.1.6
    sudo pip3.8 install --global-option=build_ext --global-option="-I/opt/python/embree/include" --global-option="-L/opt/python/embree/lib" --target=/opt/python pyembree-0.1.6.tar.gz
    

    This seems to build without problem and puts Embree and Pyembree in /opt/python. If I cd into /opt/python and run Python, I can import Pyembree, but the build can't find libembree.so.2:

    Python 3.8.5 (default, Feb 18 2021, 01:24:20)
    [GCC 7.3.1 20180712 (Red Hat 7.3.1-12)] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import pyembree
    >>> from pyembree import rtcore_scene as rtcs
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ImportError: libembree.so.2: cannot open shared object file: No such file or directory
    

    Any idea what else I should try? I'm not sure if I should be replacing embree2 with opt/python/embree/include/embree2 before building the pxd/pyx files, for example. I've also tried altering setup.py to: include_path = [np.get_include(), "/opt/python/embree/include", "/opt/python/embree/lib"].

    Any pointers very welcome!

    opened by dt99jay 1
  • segfault in destructor

    segfault in destructor

    Thanks for the great package! In a trimesh issue someone posted a backtrace that looked like it was occurring in the pyembree destructor, I was wondering if you'd ever seen anything similar?

    Thread 1 "python" received signal SIGSEGV, Segmentation fault.
    0x0000000000000000 in ?? ()
    (gdb) py-bt
    Traceback (most recent call first):
    (gdb) bt
    #0  0x0000000000000000 in ?? ()
    #1  0x00007fffd8ab7c30 in embree::avx::TriangleMeshISA::~TriangleMeshISA() ()
       from /usr/local/lib/libembree.so.2
    #2  0x00007fffd850002f in embree::Scene::~Scene() ()
       from /usr/local/lib/libembree.so.2
    #3  0x00007fffd8500179 in embree::Scene::~Scene() ()
       from /usr/local/lib/libembree.so.2
    #4  0x00007fffd84c3cc5 in rtcDeleteScene () from /usr/local/lib/libembree.so.2
    #5  0x00007fffd992474c in __pyx_pf_8pyembree_12rtcore_scene_11EmbreeScene_4__dealloc__ (__pyx_v_self=0x7fffd3166490) at pyembree/rtcore_scene.cpp:3434
    #6  __pyx_pw_8pyembree_12rtcore_scene_11EmbreeScene_5__dealloc__ (
        __pyx_v_self=<pyembree.rtcore_scene.EmbreeScene at remote 0x7fffd3166490>)
        at pyembree/rtcore_scene.cpp:3419
    #7  __pyx_tp_dealloc_8pyembree_12rtcore_scene_EmbreeScene (
        o=<pyembree.rtcore_scene.EmbreeScene at remote 0x7fffd3166490>)
        at pyembree/rtcore_scene.cpp:6042
    #8  0x00000000004fc70f in PyDict_Clear () at ../Objects/dictobject.c:946
    #9  0x00000000005419b9 in dict_tp_clear.lto_priv.332 (op=<optimized out>)
        at ../Objects/dictobject.c:2152
    #10 0x000000000049ca0f in delete_garbage (
        old=0x8fa280 <generations.lto_priv+96>, collectable=0x7fffffffdb40)
        at ../Modules/gcmodule.c:820
    #11 collect.lto_priv () at ../Modules/gcmodule.c:984
    ---Type <return> to continue, or q <return> to quit---
    #12 0x00000000004f9ade in PyGC_Collect () at ../Modules/gcmodule.c:1440
    #13 0x00000000004f8d7f in Py_Finalize () at ../Python/pythonrun.c:448
    #14 0x00000000004936f2 in Py_Main () at ../Modules/main.c:665
    #15 0x00007ffff7810830 in __libc_start_main (main=0x4932b0 <main>, argc=2, 
        argv=0x7fffffffddd8, init=<optimized out>, fini=<optimized out>, 
        rtld_fini=<optimized out>, stack_end=0x7fffffffddc8)
        at ../csu/libc-start.c:291
    #16 0x00000000004931d9 in _start ()
    
    opened by mikedh 1
  • Add distance query type

    Add distance query type

    Using the output dict to get the distance to the intersection is very slow. So I added a new query type, distance, which returns just the distance to the hit.

    opened by dwastberg 1
  • multiple scenes

    multiple scenes

    Hi, thanks for the great library!

    Someone opened an issue on trimesh about the errors that get printed when you allocate multiple scenes. It's not really a functional problem as pyembree still returns the correct result, I was wondering if there was a procedure or destructor I could call to suppress these warnings?

    import numpy as np
    
    from pyembree import rtcore_scene
    from pyembree.mesh_construction import TriangleMesh
    
    if __name__ == '__main__':
         triangles_a = np.random.random((10,3,3))
         scene_a = rtcore_scene.EmbreeScene()
         mesh_a = TriangleMesh(scene_a, triangles_a)
    
         # do something to deallocate here?
    
         triangles_b = np.random.random((10,3,3))
         scene_b = rtcore_scene.EmbreeScene()
         mesh_b = TriangleMesh(scene_b, triangles_b)
    

    produces this warning:

    ERROR CAUGHT IN EMBREE
    ERROR: Invalid operation
    ERROR MESSAGE: b'/home/benthin/Projects/embree_v251/kernels/common/rtcore.cpp (157): already initialized'
    

    Best, Mike

    opened by mikedh 1
  • These ctypedefs should define function pointers

    These ctypedefs should define function pointers

    in the same way as RTCFilterFunc in rtcore_geometry.pyx. This allows me to set custom intersection functions from cython code, in the same way that you already can with filter feedback functions:

        from mesh_intersection cimport patchIntersectFunc
        cimport pyembree.rtcore_geometry_user as rtcgu
        .
        .
        .
        rtcgu.rtcSetIntersectFunction(scene, geomID, <rtcgu.RTCIntersectFunc> patchIntersectFunc)
    
    opened by atmyers 1
  • Implementing additional mesh types in mesh_construction.pyx

    Implementing additional mesh types in mesh_construction.pyx

    This pull request adds support for creating hexahedral and tetrahedral meshes. It also implements creating triangular meshes using an indices array as well as a vertices array.

    enhancement 
    opened by atmyers 1
  • Apple Silicion Support

    Apple Silicion Support

    Since Embree 3.13.0 (https://github.com/embree/embree/releases/tag/v3.13.0) Apple Silicon is supported with Embree. pyembree should be updated to support it. Also see: https://github.com/scopatz/pyembree/issues/28

    opened by trologat 0
  • Conflict found when installing pyembree in Python3.9

    Conflict found when installing pyembree in Python3.9

    Hi, when attempting to install pyembree in a Python3.9 environment I get an error due to incompatible packages (see code below). This was tested on a MacBook Pro (2017) running macOS 10.14.6. Is there any way to resolve this?

    $ conda create --name python3.9 -c conda-forge python=3.9 pyembree
    Collecting package metadata (current_repodata.json): done
    Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
    Collecting package metadata (repodata.json): done
    Solving environment: |
    Found conflicts! Looking for incompatible packages.
    This can take several minutes.  Press CTRL-C to abort.
    failed
    
    UnsatisfiableError: The following specifications were found to be incompatible with each other:
    
    Output in format: Requested package -> Available versions
    
    Package python conflicts for:
    python=3.9
    pyembree -> numpy[version='>=1.18.1,<2.0a0'] -> python[version='3.7.*|3.8.*|>=3.9,<3.10.0a0']
    pyembree -> python[version='2.7.*|3.5.*|3.6.*|>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0|3.4.*']
    
    opened by ReinderVosDeWael 0
  • Dead link in the docstring of ElementMesh

    Dead link in the docstring of ElementMesh

    https://github.com/scopatz/pyembree/blob/master/pyembree/mesh_construction.pyx#L158 This link seems to be dead. I suppose that the node ordering is something like [[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0], [0, 0, 1], [1, 0, 1], [1, 1, 1], [0, 1, 1]] for a unit cube, right?

    [edit] same here: https://github.com/scopatz/pyembree/blob/master/pyembree/mesh_construction.h#L4

    opened by nai62 0
Releases(0.1.6)
Owner
Anthony Scopatz
Anthony Scopatz
Enhancing Knowledge Tracing via Adversarial Training

Enhancing Knowledge Tracing via Adversarial Training This repository contains source code for the paper "Enhancing Knowledge Tracing via Adversarial T

Xiaopeng Guo 14 Oct 24, 2022
Python wrapper class for OpenVINO Model Server. User can submit inference request to OVMS with just a few lines of code

Python wrapper class for OpenVINO Model Server. User can submit inference request to OVMS with just a few lines of code.

Yasunori Shimura 7 Jul 27, 2022
공공장소에서 눈만 돌리면 CCTV가 보인다는 말이 과언이 아닐 정도로 CCTV가 우리 생활에 깊숙이 자리 잡았습니다.

ObsCare_Main 소개 공공장소에서 눈만 돌리면 CCTV가 보인다는 말이 과언이 아닐 정도로 CCTV가 우리 생활에 깊숙이 자리 잡았습니다. CCTV의 대수가 급격히 늘어나면서 관리와 효율성 문제와 더불어, 곳곳에 설치된 CCTV를 개별 관제하는 것으로는 응급 상

5 Jul 07, 2022
Official code for our EMNLP2021 Outstanding Paper MindCraft: Theory of Mind Modeling for Situated Dialogue in Collaborative Tasks

MindCraft Authors: Cristian-Paul Bara*, Sky CH-Wang*, Joyce Chai This is the official code repository for the paper (arXiv link): Cristian-Paul Bara,

Situated Language and Embodied Dialogue (SLED) Research Group 14 Dec 29, 2022
Dynamical movement primitives (DMPs), probabilistic movement primitives (ProMPs), spatially coupled bimanual DMPs.

Movement Primitives Movement primitives are a common group of policy representations in robotics. There are many different types and variations. This

DFKI Robotics Innovation Center 63 Jan 06, 2023
Fusion-DHL: WiFi, IMU, and Floorplan Fusion for Dense History of Locations in Indoor Environments

Fusion-DHL: WiFi, IMU, and Floorplan Fusion for Dense History of Locations in Indoor Environments Paper: arXiv (ICRA 2021) Video : https://youtu.be/CC

Sachini Herath 68 Jan 03, 2023
NLP made easy

GluonNLP: Your Choice of Deep Learning for NLP GluonNLP is a toolkit that helps you solve NLP problems. It provides easy-to-use tools that helps you l

Distributed (Deep) Machine Learning Community 2.5k Jan 04, 2023
codes for IKM (arXiv2021, Submitted to IEEE Trans)

Image-specific Convolutional Kernel Modulation for Single Image Super-resolution This repository is for IKM introduced in the following paper Yuanfei

Yuanfei Huang 9 Dec 29, 2022
Capsule endoscopy detection DACON challenge

capsule_endoscopy_detection (DACON Challenge) Overview Yolov5, Yolor, mmdetection기반의 모델을 사용 (총 11개 모델 앙상블) 모든 모델은 학습 시 Pretrained Weight을 yolov5, yolo

MAILAB 11 Nov 25, 2022
Code and datasets for the paper "Combining Events and Frames using Recurrent Asynchronous Multimodal Networks for Monocular Depth Prediction" (RA-L, 2021)

Combining Events and Frames using Recurrent Asynchronous Multimodal Networks for Monocular Depth Prediction This is the code for the paper Combining E

Robotics and Perception Group 69 Dec 26, 2022
Imaging, analysis, and simulation software for radio interferometry

ehtim (eht-imaging) Python modules for simulating and manipulating VLBI data and producing images with regularized maximum likelihood methods. This ve

Andrew Chael 5.2k Dec 28, 2022
Faune proche - Retrieval of Faune-France data near a google maps location

faune_proche Récupération des données de Faune-France près d'un lieu google maps

4 Feb 15, 2022
Exploring Simple 3D Multi-Object Tracking for Autonomous Driving (ICCV 2021)

Exploring Simple 3D Multi-Object Tracking for Autonomous Driving Chenxu Luo, Xiaodong Yang, Alan Yuille Exploring Simple 3D Multi-Object Tracking for

QCraft 141 Nov 21, 2022
A booklet on machine learning systems design with exercises

Machine Learning Systems Design Read this booklet here. This booklet covers four main steps of designing a machine learning system: Project setup Data

Chip Huyen 7.6k Jan 08, 2023
Reinforcement learning framework and algorithms implemented in PyTorch.

Reinforcement learning framework and algorithms implemented in PyTorch.

Robotic AI & Learning Lab Berkeley 2.1k Jan 04, 2023
Physics-Aware Training (PAT) is a method to train real physical systems with backpropagation.

Physics-Aware Training (PAT) is a method to train real physical systems with backpropagation. It was introduced in Wright, Logan G. & Onodera, Tatsuhiro et al. (2021)1 to train Physical Neural Networ

McMahon Lab 230 Jan 05, 2023
Hydra: an Extensible Fuzzing Framework for Finding Semantic Bugs in File Systems

Hydra: An Extensible Fuzzing Framework for Finding Semantic Bugs in File Systems Paper Finding Semantic Bugs in File Systems with an Extensible Fuzzin

gts3.org (<a href=[email protected])"> 129 Dec 15, 2022
EvDistill: Asynchronous Events to End-task Learning via Bidirectional Reconstruction-guided Cross-modal Knowledge Distillation (CVPR'21)

EvDistill: Asynchronous Events to End-task Learning via Bidirectional Reconstruction-guided Cross-modal Knowledge Distillation (CVPR'21) Citation If y

addisonwang 18 Nov 11, 2022
Current state of supervised and unsupervised depth completion methods

Awesome Depth Completion Table of Contents About Sparse-to-Dense Depth Completion Current State of Depth Completion Unsupervised VOID Benchmark Superv

224 Dec 28, 2022
Official PyTorch implementation of U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization for Image-to-Image Translation

U-GAT-IT — Official PyTorch Implementation : Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization for Image-to-Imag

Hyeonwoo Kang 2.4k Jan 04, 2023