{"id":28381,"library":"tensorflow-graphics","title":"TensorFlow Graphics","description":"A library that provides well-defined, reusable and cleanly written graphics ops and utility functions for TensorFlow, enabling differentiable graphics rendering, transformations, and 3D geometry operations. The latest version on PyPI is 2021.12.3. Releases are infrequent and the library may lag behind TensorFlow releases.","status":"maintenance","version":"2021.12.3","language":"python","source_language":"en","source_url":"https://github.com/tensorflow/graphics","tags":["tensorflow","graphics","3d","geometry","differentiable rendering","mesh","computer graphics"],"install":[{"cmd":"pip install tensorflow-graphics","lang":"bash","label":"Default install"},{"cmd":"pip install tensorflow-graphics==2021.12.3","lang":"bash","label":"Pin to latest version"}],"dependencies":[{"reason":"Core framework for tensor operations and autograd","package":"tensorflow","optional":false},{"reason":"Numerical operations","package":"numpy","optional":false},{"reason":"Some geometry routines use scipy","package":"scipy","optional":true},{"reason":"Visualization utilities","package":"matplotlib","optional":true}],"imports":[{"note":"Incorrect path - the mesh submodule is under geometry.representation.","wrong":"from tensorflow_graphics.mesh import TriangleMesh","symbol":"TriangleMesh","correct":"from tensorflow_graphics.geometry.representation.mesh import TriangleMesh"},{"note":"Wrong module; transformation module is under geometry, not top-level.","wrong":"from tensorflow_graphics.transforms import perspective","symbol":"perspective","correct":"from tensorflow_graphics.geometry.transformation import perspective"},{"note":"Rendering submodule is named 'rendering', not 'render'.","wrong":"from tensorflow_graphics.render import rasterizer","symbol":"render","correct":"from tensorflow_graphics.rendering import rasterizer"}],"quickstart":{"code":"import tensorflow as tf\nimport tensorflow_graphics as tfg\nfrom tensorflow_graphics.geometry.representation.mesh import TriangleMesh\n\n# Create a simple mesh (cube)\nvertices = tf.constant([\n    [0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0],\n    [0, 0, 1], [1, 0, 1], [1, 1, 1], [0, 1, 1]\n], dtype=tf.float32)\nfaces = tf.constant([\n    [0, 1, 2], [2, 3, 0],\n    [1, 5, 6], [6, 2, 1],\n    [5, 4, 7], [7, 6, 5],\n    [4, 0, 3], [3, 7, 4],\n    [3, 2, 6], [6, 7, 3],\n    [4, 5, 1], [1, 0, 4]\n], dtype=tf.int32)\nmesh = TriangleMesh(vertices=vertices, indices=faces)\nprint('Mesh vertex count:', tf.shape(mesh.vertices)[0].numpy())","lang":"python","description":"Initialize a simple triangle mesh with vertices and face indices, and verify the mesh creation."},"warnings":[{"fix":"Pin tensorflow to 2.8-2.9 or use the nightly build from GitHub.","message":"TensorFlow Graphics v2021.x may not be compatible with TensorFlow 2.x later than 2.9. Installing newer tensorflow versions can cause import errors or broken ops.","severity":"breaking","affected_versions":">=2021.12.3"},{"fix":"Use with caution; consider alternative libraries for actively maintained features.","message":"The library has not been actively updated since 2021. Some modules like 'rendering' are experimental and may have breaking changes if future releases occur.","severity":"deprecated","affected_versions":"all"},{"fix":"Wrap only pure TF ops inside tf.function; keep graphics-specific ops in eager mode.","message":"Expects TensorFlow eager mode by default; using tf.function on graphics ops may cause unexpected graph tracing errors if the ops have side effects or use Python control flow.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure face winding is consistent; use tfg.geometry.representation.mesh.normals functions to verify.","message":"Mesh face indices must be in counter-clockwise order for correct normal computation, but the library does not validate orientation.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'2021.12.3':36 '3d':27,50 'behind':45 'clean':12 'comput':55 'defin':9 'differenti':22,52 'enabl':21 'function':18 'geometri':28,51 'graphic':2,14,23,49,56 'infrequ':39 'lag':44 'latest':31 'librari':4,42 'may':43 'mesh':54 'op':15 'oper':29 'provid':6 'pypi':34 'releas':37,47 'render':24,53 'reusabl':10 'tensorflow':1,20,46,48 'transform':25 'util':17 'version':32 'well':8 'well-defin':7 'written':13","created_at":"2026-05-09T05:55:12.667011+00:00","updated_at":"2026-05-09T05:55:12.667011+00:00","problems":{"verify_error":"WARNING: All log messages before absl::InitializeLog() is called are written to STDERR\nI0000 00:00:1782722169.964261  156827 cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used.\nI0000 00:00:1782722170.014714  156827 cpu_feature_guard.cc:227] This TensorFlow binary is"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/tensorflow/graphics","docs":null,"changelog":null,"pypi":"https://pypi.org/project/tensorflow-graphics/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"install_fail","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-09","install_tag":null}}