Skip to content

Commit 1473c0e

Browse files
committed
Merge branch 'main' of github.com:AIGAnimation/CAMDM
2 parents e17a8e1 + 2da6f89 commit 1473c0e

706 files changed

Lines changed: 57090 additions & 7 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

PyTorch/train.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ def train(config, resume, logger, tb_writer):
6969
args = parser.parse_args()
7070

7171
if args.cluster:
72-
args.data = '/apdcephfs/share_1330077/myishi/dataset/100STYLE_mixamo/pkls/' + args.data.split('/')[-1]
73-
args.save = '/apdcephfs/share_1330077/myishi/checkpoints/genlocal'
72+
# If the 'cluster' argument is provided, modify the 'data' and 'save' path to match your own cluster folder location
73+
args.data = 'xxxxxxx/pkls/' + args.data.split('/')[-1]
74+
args.save = 'xxxxx'
7475

7576
if args.config:
7677
config = config_parse(args)
@@ -116,4 +117,4 @@ def train(config, resume, logger, tb_writer):
116117
train(config, args.resume, logger, tb_writer)
117118
logger.info('\nTotal training time: %s mins' % ((time.time() - start_time) / 60))
118119

119-
120+

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
- Release the Windows Unity demo (GPU) trained in 100STYLE dataset.
3131
- (2024.06.23)
3232
- Release the training code in PyTorch.
33+
- (2024.07.05)
34+
- Release the inference code in Unity
3335

3436
## Getting Started
3537

@@ -49,6 +51,7 @@ F: Switch between forward mode and orientation-fixed mode.
4951
QE: Adjust the orientation in orientation-fixed mode.
5052
J: Next style
5153
L: Previous style
54+
Left Shift: Run
5255
```
5356

5457
## Train from Scratch
@@ -68,14 +71,16 @@ All the training codes and documents can be found in the subfolder of our reposi
6871
A practical training session using the entire 100STYLE dataset will take approximately one day, although acceptable checkpoints can usually be obtained after just a few hours (more than 4 hours). Following the completion of the network training, it's necessary to convert the saved checkpoints into the ONNX format. This allows them to be imported into Unity for use as a learning module. For more details, please check the subfolder.
6972

7073
### Unity Inference [[Unity]](https://github.com/AIGAnimation/CAMDM/tree/main/Unity)
71-
TBA.
74+
We use 3060 GPU in the paper
75+
76+
[Youtube tutorial](https://www.youtube.com/watch?v=nuyqpqT3F-A)
7277

7378
## ToDo-List
7479

7580
- [X] Release Unity .exe demo. (2024.04.24)
7681
- [X] Release the training code in PyTorch. (2024.06.23)
77-
- [ ] Release the inference code in Unity. (will release before 06.26
78-
- [ ] Release the evaluation code. (will release before 06.30
82+
- [X] Release the inference code in Unity. (2024.07.05
83+
- [ ] Release the evaluation code. (TBA
7984
- [ ] Release the inference code to support any character control. (TBA)
8085

8186
## Acknowledgement
@@ -100,4 +105,4 @@ This project is inspired by the following works. We appreciate their contributio
100105
```
101106

102107
## Copyright Information
103-
This project is only for research or education purposes, and not freely available for commercial use or redistribution.
108+
The unity code is released under the GPL-3 license, the rest of the source code is released under the Apache License Version 2.0

Unity/Assets/Demo.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Unity/Assets/Demo/CAMDM.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using System.Collections.Generic;
2+
using System.IO;
3+
using UnityEngine;
4+
5+
public class BVHExporter : MonoBehaviour
6+
{
7+
public string HIERARCHY_filepath = "Assets/Resources/rest.bvh";
8+
public string output_filepath = "Assets/Resources/example.bvh";
9+
public string MOTION_filepath = "Assets/Resources/motion_temp.bvh";
10+
public string condition_filepath = "Assets/Resources/condition.txt";
11+
public string speed_filepath = "Assets/Resources/speed.txt";
12+
public void Save(int Frames,Actor Actor, List<string> names = null, double frametime = 1.0 / 30.0f, string order = "zyx", bool positions = false, bool orients = true)
13+
{
14+
if (names == null)
15+
{
16+
names = new List<string>();
17+
for (int i = 0; i < Actor.Bones.Length; i++)
18+
names.Add(Actor.Bones[i].Transform.name);
19+
}
20+
StreamReader reader = new StreamReader(HIERARCHY_filepath);
21+
string content_HIERARCHY = reader.ReadToEnd();
22+
reader.Close();
23+
24+
StreamReader reader1 = new StreamReader(MOTION_filepath);
25+
string content_MOTION = reader1.ReadToEnd();
26+
reader1.Close();
27+
using (StreamWriter f = new StreamWriter(output_filepath))
28+
{
29+
f.Write(content_HIERARCHY);
30+
f.WriteLine();
31+
f.WriteLine("MOTION");
32+
f.WriteLine("Frames: {0}", Frames);
33+
f.WriteLine("Frame Time: {0}", frametime);
34+
f.Write(content_MOTION);
35+
}
36+
}
37+
}

Unity/Assets/Demo/CAMDM/BVHExporter.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)