|
42 | 42 | }, |
43 | 43 | "source": [ |
44 | 44 | "# Spherical Harmonics Approximation\n", |
45 | | - "\u003ctable class=\"tfo-notebook-buttons\" align=\"left\"\u003e\n", |
46 | | - " \u003ctd\u003e\n", |
47 | | - " \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/graphics/blob/master/tensorflow_graphics/notebooks/spherical_harmonics_approximation.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" /\u003eRun in Google Colab\u003c/a\u003e\n", |
48 | | - " \u003c/td\u003e\n", |
49 | | - " \u003ctd\u003e\n", |
50 | | - " \u003ca target=\"_blank\" href=\"https://github.com/tensorflow/graphics/blob/master/tensorflow_graphics/notebooks/spherical_harmonics_approximation.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" /\u003eView source on GitHub\u003c/a\u003e\n", |
51 | | - " \u003c/td\u003e\n", |
52 | | - "\u003c/table\u003e" |
| 45 | + "<table class=\"tfo-notebook-buttons\" align=\"left\">\n", |
| 46 | + " <td>\n", |
| 47 | + " <a target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/graphics/blob/master/tensorflow_graphics/notebooks/spherical_harmonics_approximation.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a>\n", |
| 48 | + " </td>\n", |
| 49 | + " <td>\n", |
| 50 | + " <a target=\"_blank\" href=\"https://github.com/tensorflow/graphics/blob/master/tensorflow_graphics/notebooks/spherical_harmonics_approximation.ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" />View source on GitHub</a>\n", |
| 51 | + " </td>\n", |
| 52 | + "</table>" |
53 | 53 | ] |
54 | 54 | }, |
55 | 55 | { |
|
87 | 87 | "id": "IT_MsDnVOLq1" |
88 | 88 | }, |
89 | 89 | "source": [ |
90 | | - "## Setup \u0026 Imports\n", |
| 90 | + "## Setup & Imports\n", |
91 | 91 | "If Tensorflow Graphics is not installed on your system, the following cell can install the Tensorflow Graphics package for you." |
92 | 92 | ] |
93 | 93 | }, |
|
523 | 523 | "\n", |
524 | 524 | "# SH\n", |
525 | 525 | "l, m = spherical_harmonics.generate_l_m_permutations(\n", |
526 | | - " max_band) # recomputed =\u003e optimize\n", |
| 526 | + " max_band) # recomputed => optimize\n", |
527 | 527 | "l = tf.convert_to_tensor(l)\n", |
528 | 528 | "m = tf.convert_to_tensor(m)\n", |
529 | 529 | "l_broadcasted = tf.broadcast_to(l,\n", |
|
559 | 559 | "\n", |
560 | 560 | "factor = 4.0 * np.pi / (light_image_width * light_image_height)\n", |
561 | 561 | "gt = tf.einsum(\n", |
562 | | - " \"hwn,uvn-\u003ehwuv\", surface_normal,\n", |
| 562 | + " \"hwn,uvn->hwuv\", surface_normal,\n", |
563 | 563 | " samples_direction_to_light *\n", |
564 | 564 | " tf.expand_dims(sampled_light_function, axis=-1))\n", |
565 | 565 | "gt = tf.maximum(gt, 0.0) # removes negative dot products\n", |
|
0 commit comments