davepagurek / jalgorithm

A Jalgorithm for Japplying Jeans to Jobjects

Home Page:https://people.csail.mit.edu/tzumao/diffvg/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A Jalgorithm for Japplying Jeans to Jobjects

teaser

Read the paper

For years, society has been plagued by the lack of a conclusive answer to the question of how arbitrary things would wear jeans, if they wore jeans. This paper proposes a jalgorithm to determine the mathematically optimal configuration of pants on a silhouette, leveraging recent insights in the fields of computer vision and differentiable rendering.

This is based off of the diffvg differential vector graphics renderer. It uses a customized loss function to optimize the vertices of pants, based on the following rules:

  1. Duality of man: Pants should bisect the silhouette of the wearer through its center, covering half its area.
  2. No-stretch jeans: Pants, when applied to the wearer in rest position, should not be so deformed that they no longer resemble prototypical jeans.
  3. (Topologically) torn jean avoidance: Limbs should only go through the open ends of pants, and similarly, closed ends of pants should not intersect limbs.
  4. Dress code compliance: Pants should be on the body of the wearer, not off of it.

Read the paper for more details!

You really shouldn't look at the code for this as I wrote it at 1am really quickly and hackily, but if you really want to, it's in apps/pants.py.

Results

Running the Code

  1. Follow the setup instructions from BachiLi/diffvg
  2. cd apps
  3. python pants.py

About

A Jalgorithm for Japplying Jeans to Jobjects

https://people.csail.mit.edu/tzumao/diffvg/

License:Apache License 2.0


Languages

Language:Python 66.1%Language:C++ 27.9%Language:C 3.3%Language:TeX 1.8%Language:CMake 0.9%Language:Makefile 0.0%