CARVIEW |
Select Language
HTTP/2 200
date: Sat, 26 Jul 2025 20:03:00 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/facebookresearch/pytorch3d.git
etag: W/"ef5da1da41676aa710e3cde7904843d9"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=cCRWrHBUGw5W2uhJjjm%2FvXf0Ki5mYdaPjhwUdt6LBp1CJ8gLi1rYQbI2hioxsSqaDw0Qox9fe3zvPcKOaVYz9qbdY61Eqmsy53EKFdoP2GoH7ZGtPJ5t2IuZSvyLCtVWacu1f6PHbGKz0zTCtCTzKuMq8lX4ZRLLz30WbfEPHA4p2jE1vQXxFAoWUcSh4z5wWjstxZg3vcM4b6czdmq%2BX%2FmLzTbOzEZfE7CueUc%2FGXaKtUVhm4UzovkXCdTVWgFe%2BigOb7dLkst0a1papEeL%2Bw%3D%3D--m2lKLKTyiIWwOay3--w0o3YYRvk7U3Ooici3tjqg%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1361641694.1753560179; Path=/; Domain=github.com; Expires=Sun, 26 Jul 2026 20:02:59 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Sun, 26 Jul 2026 20:02:59 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: 888C:37D5F1:89E5DB:B26899:68853473
renderer: add support for rendering high dimensional textures for cla… · facebookresearch/pytorch3d@8d10ba5 · GitHub
Copy file name to clipboardExpand all lines: pytorch3d/renderer/lighting.py
Copy file name to clipboardExpand all lines: pytorch3d/renderer/materials.py
Copy file name to clipboard
Copy file name to clipboardExpand all lines: tests/test_render_meshes.py
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit 8d10ba5
renderer: add support for rendering high dimensional textures for classification/segmentation use cases (#1248)
Summary:
For 3D segmentation problems it's really useful to be able to train the models from multiple viewpoints using Pytorch3D as the renderer. Currently due to hardcoded assumptions in a few spots the mesh renderer only supports rendering RGB (3 dimensional) data. You can encode the classification information as 3 channel data but if you have more than 3 classes you're out of luck.
This relaxes the assumptions to make rendering semantic classes work with `HardFlatShader` and `AmbientLights` with no diffusion/specular. The other shaders/lights don't make any sense for classification since they mutate the texture values in some way.
This only requires changes in `Materials` and `AmbientLights`. The bulk of the code is the unit test.
Pull Request resolved: #1248
Test Plan: Added unit test that renders a 5 dimensional texture and compare dimensions 2-5 to a stored picture.
Reviewed By: bottler
Differential Revision: D37764610
Pulled By: d4l3k
fbshipit-source-id: 031895724d9318a6f6bab5b31055bb3f438176a51 parent aa8b03f commit 8d10ba5Copy full SHA for 8d10ba5
File tree
Expand file treeCollapse file tree
4 files changed
+101
-12
lines changedFilter options
- pytorch3d/renderer
- tests
- data
Expand file treeCollapse file tree
4 files changed
+101
-12
lines changedpytorch3d/renderer/lighting.py
Copy file name to clipboardExpand all lines: pytorch3d/renderer/lighting.py+14-5Lines changed: 14 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
292 | 292 |
| |
293 | 293 |
| |
294 | 294 |
| |
| 295 | + | |
| 296 | + | |
| 297 | + | |
295 | 298 |
| |
296 | 299 |
| |
297 | 300 |
| |
| |||
304 | 307 |
| |
305 | 308 |
| |
306 | 309 |
| |
307 |
| - | |
308 |
| - | |
309 |
| - | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
310 | 315 |
| |
311 | 316 |
| |
312 | 317 |
| |
| |||
317 | 322 |
| |
318 | 323 |
| |
319 | 324 |
| |
320 |
| - | |
| 325 | + | |
321 | 326 |
| |
322 | 327 |
| |
323 |
| - | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
324 | 333 |
| |
325 | 334 |
| |
326 | 335 |
| |
|
pytorch3d/renderer/materials.py
Copy file name to clipboardExpand all lines: pytorch3d/renderer/materials.py+9-7Lines changed: 9 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
30 |
| - | |
31 |
| - | |
32 |
| - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
40 |
| - | |
| 40 | + | |
| 41 | + | |
41 | 42 |
| |
42 | 43 |
| |
43 | 44 |
| |
| |||
49 | 50 |
| |
50 | 51 |
| |
51 | 52 |
| |
| 53 | + | |
52 | 54 |
| |
53 | 55 |
| |
54 |
| - | |
55 |
| - | |
56 |
| - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
57 | 59 |
| |
58 | 60 |
| |
59 | 61 |
| |
|
tests/data/test_nd_sphere.png
Copy file name to clipboard55.9 KB
Loading
tests/test_render_meshes.py
Copy file name to clipboardExpand all lines: tests/test_render_meshes.py+78Lines changed: 78 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1236 | 1236 |
| |
1237 | 1237 |
| |
1238 | 1238 |
| |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + |
You can’t perform that action at this time.
0 commit comments