fix usage
Browse files
README.md
CHANGED
@@ -5,16 +5,17 @@ Example usage:
|
|
5 |
|
6 |
```
|
7 |
def demo_usage(somg_npz_path):
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
18 |
```
|
19 |
|
20 |
# Model Card for Model ID
|
|
|
5 |
|
6 |
```
|
7 |
def demo_usage(somg_npz_path):
|
8 |
+
from diffusers import AutoencoderKL
|
9 |
+
mymodel = AutoencoderKL.from_pretrained("3dlg-hcvc/m0425_aekl_ABO_xyzob_mse_normalloss_randtransf3_vae").to('cuda:3')
|
10 |
+
|
11 |
+
from xgutils.somgutil_torch import omg_encode_np, omg_decode_np, omg_autoencode_np
|
12 |
+
somg = somgutil.import_somg(somg_npz_path)
|
13 |
+
omg = somgutil.somg2omgG(somg, trim_omg=True)[None,...]
|
14 |
+
z = omg_encode_np(mymodel, omg)
|
15 |
+
x_output = omg_decode_np(mymodel, z['z'])
|
16 |
+
x_output = x_output['x_output'][0]
|
17 |
+
visutil.showImg(x_output)
|
18 |
+
demo_usage("ABO_DATA_ROOT/2/B01DJH73X2/somage.npz")
|
19 |
```
|
20 |
|
21 |
# Model Card for Model ID
|