jhj0517 commited on
Commit
0a8c924
β€’
1 Parent(s): 1c12178

add colab notebook

Browse files
Files changed (1) hide show
  1. notebook/musepose_webui.ipynb +144 -0
notebook/musepose_webui.ipynb ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "nbformat": 4,
3
+ "nbformat_minor": 0,
4
+ "metadata": {
5
+ "colab": {
6
+ "provenance": [],
7
+ "machine_shape": "hm",
8
+ "gpuType": "L4"
9
+ },
10
+ "kernelspec": {
11
+ "name": "python3",
12
+ "display_name": "Python 3"
13
+ },
14
+ "language_info": {
15
+ "name": "python"
16
+ },
17
+ "accelerator": "GPU"
18
+ },
19
+ "cells": [
20
+ {
21
+ "cell_type": "markdown",
22
+ "source": [
23
+ "---\n",
24
+ "\n",
25
+ "πŸ“Œ **This notebook has been updated [here](https://github.com/jhj0517/MusePose-WebUI)!**\n",
26
+ "\n",
27
+ "πŸ–‹ **Author**: [jhj0517](https://github.com/jhj0517/Whisper-WebUI/blob/master/notebook/whisper-webui.ipynb)\n",
28
+ "\n",
29
+ "😎 **Support the Project**:\n",
30
+ "\n",
31
+ "If you find this project useful, please consider supporting it:\n",
32
+ "\n",
33
+ "<a href=\"https://ko-fi.com/A0A7JSQRJ\" target=\"_blank\">\n",
34
+ " <img src=\"https://storage.ko-fi.com/cdn/kofi2.png?v=3\" alt=\"Buy Me a Coffee at ko-fi.com\" height=\"36\">\n",
35
+ "</a>\n",
36
+ "\n",
37
+ "---"
38
+ ],
39
+ "metadata": {
40
+ "id": "zW0EANufPvGU"
41
+ }
42
+ },
43
+ {
44
+ "cell_type": "code",
45
+ "execution_count": null,
46
+ "metadata": {
47
+ "cellView": "form",
48
+ "id": "cX7SwywlzrS4"
49
+ },
50
+ "outputs": [],
51
+ "source": [
52
+ "#@title #Installation\n",
53
+ "#@markdown This will install dependencies for musepose webui\n",
54
+ "\n",
55
+ "!git clone https://github.com/jhj0517/MusePose-WebUI.git\n",
56
+ "%cd MusePose-WebUI\n",
57
+ "!pip install -r requirements.txt\n"
58
+ ]
59
+ },
60
+ {
61
+ "cell_type": "code",
62
+ "source": [
63
+ "#@title #Mount Your Google Drive for Paths\n",
64
+ "#@markdown Enter your models & output directory paths. Remove these default values below and enter yours.\n",
65
+ "\n",
66
+ "MusePose_Model_Path = '/content/drive/MyDrive/MusePose/pretrained_weights' # @param {type:\"string\"}\n",
67
+ "Output_Dir = '/content/drive/MyDrive/MusePose/output_folder' # @param {type:\"string\"}\n",
68
+ "\n",
69
+ "#@markdown You should prepare folder like `Your_MusePose_Models` folder with the following structure on your Google Drive:\n",
70
+ "#@markdown ```\n",
71
+ "#@markdown ./Your_MusePose_Models/\n",
72
+ "#@markdown |-- MusePose\n",
73
+ "#@markdown | |-- denoising_unet.pth\n",
74
+ "#@markdown | |-- motion_module.pth\n",
75
+ "#@markdown | |-- pose_guider.pth\n",
76
+ "#@markdown | β””-- reference_unet.pth\n",
77
+ "#@markdown |-- dwpose\n",
78
+ "#@markdown | |-- dw-ll_ucoco_384.pth\n",
79
+ "#@markdown | └── yolox_l_8x8_300e_coco.pth\n",
80
+ "#@markdown |-- sd-image-variations-diffusers\n",
81
+ "#@markdown | └── unet\n",
82
+ "#@markdown | |-- config.json\n",
83
+ "#@markdown | β””-- diffusion_pytorch_model.bin\n",
84
+ "#@markdown |-- image_encoder\n",
85
+ "#@markdown | |-- config.json\n",
86
+ "#@markdown | β””-- pytorch_model.bin\n",
87
+ "#@markdown β””-- sd-vae-ft-mse\n",
88
+ "#@markdown |-- config.json\n",
89
+ "#@markdown β””-- diffusion_pytorch_model.bin\n",
90
+ "#@markdown ```\n",
91
+ "\n",
92
+ "#@markdown You can download weigths here: [ReadMe](https://github.com/TMElyralab/MusePose?tab=readme-ov-file#download-weights)\n",
93
+ "\n",
94
+ "\n",
95
+ "# Mount Google Drive\n",
96
+ "from google.colab import drive\n",
97
+ "import os\n",
98
+ "drive.mount('/content/drive')\n",
99
+ "\n",
100
+ "\n",
101
+ "# Symlink model path with google drive and local\n",
102
+ "local_model_path = '/content/MusePose-WebUI/pretrained_weights'\n",
103
+ "os.makedirs(local_model_path, exist_ok=True)\n",
104
+ "\n",
105
+ "for item in os.listdir(MusePose_Model_Path):\n",
106
+ " item_path = os.path.join(MusePose_Model_Path, item)\n",
107
+ " symlink_path = os.path.join(local_model_path, item)\n",
108
+ " os.symlink(item_path, symlink_path)\n",
109
+ "!ls \"$local_model_path\"\n",
110
+ "\n",
111
+ "# Symlink output path with google drive and local\n",
112
+ "local_output_path = '/content/MusePose-WebUI/outputs'\n",
113
+ "os.makedirs(local_output_path, exist_ok=True)\n",
114
+ "\n",
115
+ "if os.path.exists(local_output_path):\n",
116
+ " !rm -r \"$local_output_path\"\n",
117
+ "\n",
118
+ "os.symlink(Output_Dir, local_output_path)\n",
119
+ "!ls \"$local_output_path\""
120
+ ],
121
+ "metadata": {
122
+ "cellView": "form",
123
+ "id": "IbkdctzO0S2n"
124
+ },
125
+ "execution_count": null,
126
+ "outputs": []
127
+ },
128
+ {
129
+ "cell_type": "code",
130
+ "source": [
131
+ "#@title # Run Web UI\n",
132
+ "#@markdown Now you can run the MusePose webui, Use public URL that is displayed\n",
133
+ "\n",
134
+ "!python app.py --share"
135
+ ],
136
+ "metadata": {
137
+ "id": "OXoOcH7n05lo",
138
+ "cellView": "form"
139
+ },
140
+ "execution_count": null,
141
+ "outputs": []
142
+ }
143
+ ]
144
+ }