From the course: Grasshopper: Tips, Tricks, and Techniques
Setting up training data in Crow
From the course: Grasshopper: Tips, Tricks, and Techniques
Setting up training data in Crow
- [Instructor] Welcome. This is the second in a series of five videos that focus on machine learning within Grasshopper 3D, specifically using the Crow plugin, because Crow does such a good job of organizing its components in a way that explain or illustrate the principles of neural networks and machine learning. So in this specific video, we're going to focus on preparing a face mesh for training the neural network. And the goal is to create a neural network that can recognize the features of a face. So it can recognize the nose, the chin, and the cheeks of any arbitrary mesh that's shaped like a face. So it can determine which parts of the mesh are which parts of the face. And then we can use that classification, that organization. to orient mask geometry. So we can optimize the development of the shape of respirators to match different faces. So here's our sample that we're going to use for training. And what I want to do is prepare this sample so that I get rid of the location of the face in space. Cause that's not what makes it a face. What makes it a face are the relationships between the different pieces of the face so that it can be recognized if it's rotated around or if it's moving in different locations in the Cartesian system. So I'm going to go to mesh, face normals, and we're going to use the center point of each face and the normal each face as a way to start off recognizing this geometry. So I'm going to go math, average and we get the average of all the center points. And then I'm going to create a vector from that average point, which is sort of the center point, you can see there, like a centroid for this geometry, to the center point of each face. I'm going to get the normal as well. So I'll go back to params, vector. Okay. So now I have the orientation of each face and I also have the relationship between the face center point and a sort of middle centroid of the face. And then the last thing I'm going to add here, as a way to describe this form, I'm going to go to vector plane, plane fit. I'm going to fit a plane through all these points here. You can see the plane right there, and I'm going to project the points onto the plane. What I'm going to do is get basically a flat version of the face that kind of tracks the relationship between the boundary of the outside face or an average of that boundary and each point on the face. So we'll go to plane and we're going to get the plane coordinates for each of these points. And this is basically projecting without using the project command. So point oriented, I'm going to plug in the plane, plug in X and Y. So now I have those points on that plane. I'm going to go to mesh, triangulation, convex hall. And this just gives me the outside boundary of that bunch of points. And then I'm going to get another vector here that is, I'll go to curve, curve closest point. And I'll get a vector that's from these points, the center points of each face, to the curve, right? And I'll store that as a vector as well. So I want to go to point. So starting from the closest point of the curve to the point itself, and now I'm going to flatten each of these, I'm just going to flatten them and then I'm going to graph them. That way I know that they'll always be consistent in terms of the data tree structure. So I'll go to vector, point, and I want point to numbers, and this I'm going to graft. So these data trees should be the same and I'm actually going to simplify them. So now we have consistent, simple data trees coming out of each one. We're going to merge those together by using the merge component. Now I should have a set of nine numbers come down here. And those nine numbers should be an effective description of that mesh object but a description that is independent of its location. And there's probably a lot of ways to do this better. This is just an initial attempt. So if I were doing this and really looking to ensure performance I would probably spent a lot of time tweaking and refining the way I did that conversion from a regular mesh object to these sets of points that describe that mesh object. But for our purposes, I think this will work. So I'm going to just cluster this up. So it becomes basically our little tool that we can use to convert meshes into descriptions for machine learning training. All right. So now we have that set up and in the next video, we're going to look at how we actually do our classifications of the same mesh so that we can run our training on our actual neural network. And before we do that, we can plug in these numbers, cause this is going to be our training in data. And I'll see you in the next video.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
(Locked)
Leveraging NURBS: Sampling5m 20s
-
(Locked)
Leveraging NURBS: UVW space6m 13s
-
(Locked)
Leveraging NURBS: Reparameterization6m 23s
-
(Locked)
Leveraging NURBS: Solving on plane5m 41s
-
(Locked)
Leveraging NURBS: Curves as math functions5m 37s
-
(Locked)
Leveraging NURBS: One-degree surfaces5m
-
(Locked)
Leveraging NURBS: NURBS or meshes? Part 14m 41s
-
(Locked)
Leveraging NURBS: NURBS or meshes? Part 25m 21s
-
(Locked)
Leveraging NURBS: What is BREP?5m 15s
-
(Locked)
Leveraging NURBS: Alternatives to Boolean, part 18m 35s
-
(Locked)
Leveraging NURBS: Alternatives to Boolean, part 25m 57s
-
(Locked)
Leveraging NURBS: Alternatives to Boolean, Part 36m 33s
-
(Locked)
Leveraging NURBS: Extracting planes from curves6m 19s
-
(Locked)
Leveraging NURBS: Extracting planes from surfaces6m 39s
-
(Locked)
Understanding offset directionality6m 30s
-
(Locked)
Offsetting variable curves consistently5m 57s
-
(Locked)
Offsetting polygons7m 33s
-
(Locked)
Equal spacing along a curve for linkages7m 24s
-
(Locked)
Paneling tools and NURBS sampling5m 26s
-
(Locked)
Breaking down the paneling tools4m 3s
-
(Locked)
Buildable 3D paneling9m 11s
-
(Locked)
Understanding unrolling in Grasshopper3m 25s
-
(Locked)
Scripting your own unroller5m 27s
-
(Locked)
Unfolding from scratch, part 15m 8s
-
Unfolding from scratch, part 26m 31s
-
(Locked)
Why data trees?6m 20s
-
(Locked)
Intentional data trees8m 28s
-
(Locked)
Installing plugins5m 57s
-
Fabrication: Ivy fundamentals6m 49s
-
(Locked)
Fabrication: Ivy for a multiple parts4m 32s
-
(Locked)
Fabrication: Ivy for fabrication10m 13s
-
(Locked)
OpenNest6m 1s
-
(Locked)
Pancake4m 31s
-
(Locked)
Human: Setting data6m 54s
-
(Locked)
Human: Getting data7m 8s
-
(Locked)
Anemone: Basics4m 10s
-
(Locked)
Anemone: Convex hull4m 3s
-
(Locked)
Anenome: Custom convex6m 27s
-
(Locked)
Intralattice4m 9s
-
(Locked)
Metahopper5m 44s
-
(Locked)
Chromodoris6m 38s
-
(Locked)
Dealing with empty branches5m 14s
-
(Locked)
Data trees as lists4m 27s
-
(Locked)
Iteration instead of data trees4m 44s
-
(Locked)
Sorting inputs3m 52s
-
(Locked)
Sorted geometry to data tree7m 35s
-
(Locked)
Data trees and scripting6m 53s
-
(Locked)
Data trees as a master index and ID4m 21s
-
(Locked)
Vector intro6m 23s
-
(Locked)
Plane intro3m 59s
-
(Locked)
Vector math, part 15m 46s
-
(Locked)
Vector math, part 24m 16s
-
(Locked)
Operating in different cartesian systems5m 58s
-
(Locked)
Operating in twisted spaces, NURBS systems6m 44s
-
(Locked)
Installing Crow9m 21s
-
Setting up training data in Crow5m 43s
-
(Locked)
Prep the neural network in Crow5m 54s
-
(Locked)
Apply the network to classify face parts5m 57s
-
(Locked)
Using classification8m 22s
-
(Locked)
Installing Wallacei4m 15s
-
(Locked)
Setting up Wallacei4m 51s
-
(Locked)
Wallacei goals5m 48s
-
(Locked)
Wallacei goal tuning6m 31s
-
(Locked)
Wallacei output4m 37s
-
(Locked)
Weaverbird meshing5m 47s
-
(Locked)
Mesh+ and mesh editing4m 43s
-
(Locked)
NGon: Reciprocal4m 5s
-
(Locked)
NGon: Reciprocal 3D6m 35s
-
(Locked)
AXOLOTL: Conformal6m 1s
-
(Locked)
Opossum: Control5m 42s
-
(Locked)
AXOLOTL: Smooth branching6m 7s
-
(Locked)
FlexHopper: Particles4m 8s
-
(Locked)
FlexHopper: Particles clean6m 34s
-
(Locked)
FlexHopper: Particles agitate6m 34s
-
(Locked)
PhysX.GH: Stability4m 47s
-
(Locked)
PhysX.GH: Collision4m 3s
-
(Locked)
PhysX.GH: Catenary4m 35s
-
Heteroptera: Network tools4m 43s
-
(Locked)
Heteroptera landscape5m 24s
-
(Locked)
Why coding: C#5m 29s
-
(Locked)
Reading RhinoDoc3m 58s
-
(Locked)
Read object5m 40s
-
(Locked)
Write object6m 28s
-
(Locked)
Object types5m 44s
-
(Locked)
List inputs4m 53s
-
(Locked)
Data tree inputs5m 9s
-
(Locked)
Exporting geometry5m 18s
-
(Locked)
Reading CSV4m 28s
-
(Locked)
Reading settings5m 42s
-
(Locked)
Reading writing5m 23s
-
(Locked)
ScriptParasite4m 36s
-
(Locked)
Reduce mesh5m 38s
-
(Locked)
Unfolding/unrolling initial6m 23s
-
(Locked)
Unfolding/unrolling transform geometry4m 54s
-
(Locked)
Change surface degree6m 58s
-
(Locked)
Lowest possible degree (keep checking until it works)5m 10s
-
(Locked)
Fit surface4m 21s
-
(Locked)
Fit surface: Iterative to increase tolerance until it works4m 11s
-
(Locked)
Running a batch5m 48s
-
(Locked)
Advanced batch processing7m 1s
-
(Locked)
Understanding and reusing transformations5m 8s
-
(Locked)
Compounding and reversing transformations7m 20s
-
(Locked)
Zebra5m 11s
-
(Locked)
New in v7: Quad Remesh, part 16m 5s
-
(Locked)
New in v7: Quad Remesh, part 26m 1s
-
(Locked)
New in v7: Grasshopper Player, part 14m 50s
-
(Locked)
New in v7: Grasshopper Player, part 27m 5s
-
(Locked)
New in v7: Scripting, part 16m 46s
-
(Locked)
New in v7: Scripting, part 25m 25s
-
(Locked)
New in v7: SubD tools, part 17m 46s
-
(Locked)
New in v7: SubD tools, part 25m 19s
-
(Locked)
New in v7: SubD tools, part 34m 28s
-
(Locked)
New in v7: Drafting, part 15m 15s
-
(Locked)
New in v7: Drafting, part 26m 59s
-
(Locked)
New in v7: Drafting, part 38m 21s
-
(Locked)
New in v7: Drafting, part 44m 32s
-
(Locked)