Skip to content

This repository contains Python machine learning nodes for instructional use only—NOT for production. All inferences are based on pure math, with no external libraries, to help you understand the underlying algorithms step by step.

License

Notifications You must be signed in to change notification settings

lopezmauro/ml-example-nodes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

This repository contains example implementations of machine learning nodes for Autodesk Maya. These nodes are designed for instructional purposes and are not intended for production use. The nodes included are:

  • Regression Node: Performs linear regression inference based on input features.
  • PCA Blendshape Node: Performs Principal Component Analysis (PCA) to create blendshapes for mesh deformation.

Files

  • regression_node.py: Implementation of the Regression node.
  • regression_win.py: UI for creating and managing Regression nodes in Maya.
  • pca_blendshape.py: Implementation of the PCA blendshape node.
  • pca_win.py: UI for creating and managing PCA blendshape nodes in Maya.

Installation

  1. Clone the repository:
    git clone https://github.com/yourusername/ml-example-nodes.git
  2. Copy the Python files to your Maya scripts directory, or Add Repository to System Path using sys.path.append.
    import sys
    sys.path.append('path/to/your/repo')

Usage

Regression Node

  1. Open Maya and load the script editor.
  2. To open the Regression UI execute:
import nodes_ui
nodes_ui.regrssion_ui()
  1. Select the input attributes, set the output attribute, and create the Regression node.

Reegression UI

  1. Launch the UI: Run the show() function from regression_ui.py to display the UI.
  2. Set Input Attributes: Add input attributes to the input list widget.
  3. Set Output Attributes: Add output attributes to the target list widget.
  4. Get Animation Data: If the scene has anmation, use it for train else, check the box to generate random animation curves and set the parameters (start frame, end frame, min value, max value).
  5. Train the Model: Click the button to train the Linear Regression model using the provided data and settings.

PCA Blendshape Node

  1. Open Maya and load the script editor.
  2. To open the PCA Blendshape UI execute:
import nodes_ui
nodes_ui.pca_ui()
  1. Select the source blendshape node and target mesh.
  2. Click the "Create PCA Blendshape" button to create the PCA blendshape node.

PCA Blendshape Features

The PCA blendshape node converts the selected blendshape to the PCA space. By default, it does not compress the data. Instead, it allows the user to choose the desired level of compression. This means the user can decide how much variation to retain, balancing between data size reduction and the amount of variation preserved.

  • Compression Ratio: The desired variance to keep for compression.
  • Compression Result: The actual compression percentage achieved.

Dependencies

  • Autodesk Maya
  • NumPy
  • scikit-learn
  • PySide2

License

This project is licensed under the MIT License. See the LICENSE file for details.

Disclaimer

These nodes are provided as-is for educational purposes only. They are not intended for production use and come with no warranty or support.

About

This repository contains Python machine learning nodes for instructional use only—NOT for production. All inferences are based on pure math, with no external libraries, to help you understand the underlying algorithms step by step.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages