Skip to content

Commit 39a4b0f

Browse files
committed
Refactored code for AddBiomechanics and previous datasets
1 parent 53abc6b commit 39a4b0f

8 files changed

+266
-247
lines changed

Dockerfile

+13-17
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Use an official Ubuntu runtime as a parent image
2-
FROM ubuntu:22.04
2+
FROM ubuntu:25.04
33

44
# Set the working directory
5-
WORKDIR /P-BIGE
5+
WORKDIR /BIGE
66

77
# Install necessary dependencies
8-
RUN apt-get update && apt-get install -y wget git htop xvfb
8+
RUN apt-get update && apt-get install -y wget git htop xvfb build-essential
99

1010
# Install Miniconda
1111
RUN MINICONDA_INSTALLER_SCRIPT=Miniconda3-py38_23.1.0-1-Linux-x86_64.sh && \
@@ -19,25 +19,21 @@ RUN MINICONDA_INSTALLER_SCRIPT=Miniconda3-py38_23.1.0-1-Linux-x86_64.sh && \
1919
ENV PATH=/usr/local/bin:$PATH
2020

2121
# Copy the entire repo (including environment.yml) into the image
22-
COPY . /P-BIGE
22+
COPY . /BIGE
2323

2424
# Create the conda environment from environment.yml
25-
RUN conda env create -f environment.yml
25+
RUN conda env create -f enviornment.yaml
2626

2727
# Activate the conda environment for subsequent RUN commands
28-
SHELL ["conda", "run", "-n", "P-BIGE", "/bin/bash", "-c"]
28+
SHELL ["conda", "run", "-n", "BIGE", "/bin/bash", "-c"]
2929

30-
# Download the model and extractor
31-
RUN bash dataset/prepare/download_model.sh && \
32-
bash dataset/prepare/download_extractor.sh
30+
# # Install additional Python packages (if needed)
31+
# RUN pip install --user ipykernel polyscope easydict trimesh
32+
# RUN pip install --user --force-reinstall numpy==1.22.0
3333

34-
# Install additional Python packages (if needed)
35-
RUN pip install --user ipykernel polyscope easydict trimesh
36-
RUN pip install --user --force-reinstall numpy==1.22.0
37-
38-
# Set up Xvfb for Polyscope
39-
ENV DISPLAY=:99.0
40-
RUN Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
34+
# # Set up Xvfb for Polyscope
35+
# ENV DISPLAY=:99.0
36+
# RUN Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
4137

4238
# Set the entrypoint to use the conda environment
43-
ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "P-BIGE", "python"]
39+
ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "BIGE", "python"]

dataset/dataset_MOT_segmented.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def __getitem__(self, item):
205205
return subsequences, subsequence_lengths, names
206206

207207
class AddBiomechanicsDataset(data.Dataset):
208-
def __init__(self, window_size=64, unit_length=4, mode='train', data_dir='/home/mnt/data/addb_dataset_publication'):
208+
def __init__(self, window_size=64, unit_length=4, mode='train', data_dir='/home/kingn450/Datasets/addb_dataset_publication'):
209209
self.window_size = window_size
210210
self.unit_length = unit_length
211211
self.data_dir = data_dir

dev-pod.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: dev-pod
5+
spec:
6+
containers:
7+
- name: sleep
8+
image: ncking/p-bige:latest
9+
command: ["/bin/bash", "-c"]
10+
args: ["sleep infinity"]
11+
resources:
12+
limits:
13+
nvidia.com/gpu: 1
14+
requests:
15+
nvidia.com/gpu: 1
16+
volumeMounts:
17+
- name: biomechanics-dataset
18+
mountPath: /home/mnt/data
19+
volumes:
20+
- name: biomechanics-dataset
21+
persistentVolumeClaim:
22+
claimName: add-biomechanics-dataset-pvc
23+
restartPolicy: Never

enviornment.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: BIGE
2+
channels:
3+
- defaults
4+
- nvidia
5+
- pytorch
6+
dependencies:
7+
- cudatoolkit
8+
- imageio
9+
- matplotlib
10+
- python=3.10
11+
- scipy
12+
- tensorboard
13+
- pip:
14+
- deepspeed
15+
- git+https://github.com/nghorbani/human_body_prior
16+
- git+https://github.com/openai/CLIP.git
17+
- nimblephysics

environment.yml

+12-14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: P-BIGE
1+
name: T2M-GPT
22
channels:
33
- pytorch
44
- defaults
@@ -71,26 +71,20 @@ dependencies:
7171
- chumpy==0.70
7272
- cycler==0.10.0
7373
- decorator==5.0.9
74-
- deepspeed==0.5.8
75-
- gdown
76-
- git+https://github.com/nghorbani/human_body_prior
77-
- git+https://github.com/openai/CLIP.git
78-
- google-auth-oauthlib==0.4.5
7974
- google-auth==1.35.0
75+
- google-auth-oauthlib==0.4.5
8076
- grpcio==1.39.0
8177
- idna==3.2
8278
- imageio==2.9.0
8379
- ipdb==0.13.9
84-
- ipython-genutils==0.2.0
8580
- ipython==7.26.0
81+
- ipython-genutils==0.2.0
8682
- jedi==0.18.0
8783
- joblib==1.0.1
8884
- kiwisolver==1.3.1
8985
- markdown==3.3.4
90-
- matplotlib-inline==0.1.2
9186
- matplotlib==3.4.3
92-
- moviepy
93-
- nimblephysics
87+
- matplotlib-inline==0.1.2
9488
- oauthlib==3.1.1
9589
- pandas==1.3.2
9690
- parso==0.8.2
@@ -99,27 +93,31 @@ dependencies:
9993
- prompt-toolkit==3.0.20
10094
- protobuf==3.17.3
10195
- ptyprocess==0.7.0
102-
- pyasn1-modules==0.2.8
10396
- pyasn1==0.4.8
97+
- pyasn1-modules==0.2.8
10498
- pygments==2.10.0
10599
- pyparsing==2.4.7
106100
- python-dateutil==2.8.2
107101
- pytz==2021.1
108102
- pyyaml==5.4.1
109-
- requests-oauthlib==1.3.0
110103
- requests==2.26.0
104+
- requests-oauthlib==1.3.0
111105
- rsa==4.7.2
112106
- scikit-learn==0.24.2
113107
- scipy==1.7.1
114108
- sklearn==0.0
115109
- smplx==0.1.28
110+
- tensorboard==2.6.0
116111
- tensorboard-data-server==0.6.1
117112
- tensorboard-plugin-wit==1.8.0
118-
- tensorboard==2.6.0
119113
- threadpoolctl==2.2.0
120114
- toml==0.10.2
121115
- tqdm==4.62.2
122116
- traitlets==5.0.5
123117
- urllib3==1.26.6
124118
- wcwidth==0.2.5
125-
- werkzeug==2.0.1
119+
- werkzeug==2.0.1
120+
- git+https://github.com/openai/CLIP.git
121+
- git+https://github.com/nghorbani/human_body_prior
122+
- gdown
123+
- moviepy

models/vqvae.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def __init__(self,
2121
self.code_dim = code_dim
2222
self.num_code = nb_code
2323
self.quant = args.quantizer
24-
self.encoder = Encoder(23 if args.dataname == 'mcs' else 263, output_emb_width, down_t, stride_t, width, depth, dilation_growth_rate, activation=activation, norm=norm)
25-
self.decoder = Decoder(23 if args.dataname == 'mcs' else 263, output_emb_width, down_t, stride_t, width, depth, dilation_growth_rate, activation=activation, norm=norm)
24+
self.encoder = Encoder(23 if args.dataname == 'mcs' or args.dataname == 'addb' else 263, output_emb_width, down_t, stride_t, width, depth, dilation_growth_rate, activation=activation, norm=norm)
25+
self.decoder = Decoder(23 if args.dataname == 'mcs' or args.dataname == 'addb' else 263, output_emb_width, down_t, stride_t, width, depth, dilation_growth_rate, activation=activation, norm=norm)
2626
if args.quantizer == "ema_reset":
2727
self.quantizer = QuantizeEMAReset(nb_code, code_dim, args)
2828
elif args.quantizer == "orig":

0 commit comments

Comments
 (0)