linlinlinlinsdada commited on
Commit
e50e8d0
·
verified ·
1 Parent(s): eba9258

Model card

Browse files
Files changed (1) hide show
  1. README.md +37 -4
README.md CHANGED
@@ -39,13 +39,46 @@ The files are PyTorch state dictionaries that hold tensors only (loaded with `we
39
  git clone https://github.com/Carol-lyh/Jeveration && cd Jeveration
40
  pip install -r requirements.txt
41
  hf download linlinlinlinsdada/Jeveration --local-dir weights
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
- python generate.py --weights weights/jeveration.pt --decoder weights/decoder512.pt \
44
- --prompt "a dragon curled up inside a porcelain teacup" --seed 0 --out samples/
 
45
  ```
46
 
47
- Image-to-image and dense prediction are described in the repository's README. Three public models are downloaded on
48
- first use, each under its own license: the backbone `Qwen/Qwen3.5-4B`, the tokenizer
49
  `turkeyju/tokenizer_tatitok_bl128_vq` and the CLIP ViT-L/14-336 text tower `timm/vit_large_patch14_clip_336.openai`.
50
 
51
  ## Scope
 
39
  git clone https://github.com/Carol-lyh/Jeveration && cd Jeveration
40
  pip install -r requirements.txt
41
  hf download linlinlinlinsdada/Jeveration --local-dir weights
42
+ ```
43
+
44
+ One pipeline serves every task. The inputs of this example are in the repository's `examples/` folder.
45
+
46
+ ```python
47
+ import numpy as np
48
+ from PIL import Image
49
+ from jeveration import JeverationPipeline
50
+ from jeveration.images import load_square, to_gray
51
+
52
+ pipe = JeverationPipeline("weights/jeveration.pt", decoder="weights/decoder512.pt",
53
+ source_decoder="weights/source_decoder512.pt")
54
+
55
+ # Text-to-image: a list of prompts -> uint8 images [B, 512, 512, 3]
56
+ images = pipe.text_to_image(["A tiny dragon sleeping inside a porcelain teacup, cozy warm light, fantasy art."], pipe.generator(0))
57
+ Image.fromarray(images[0]).save("dragon.png")
58
+
59
+ # Structure to image: an edge map ("hed") or a depth map ("depth"), with a caption of the wanted image
60
+ edges = load_square("examples/hed_cabin.png")
61
+ images = pipe.image_to_image(edges[None], "hed", ["A cozy wooden cabin on a lake shore in autumn, smoke from the chimney."],
62
+ generator=pipe.generator(0))
63
+ Image.fromarray(images[0]).save("cabin.png")
64
+
65
+ # Colorization of a grey picture
66
+ gray = to_gray(load_square("examples/gray_burger.jpg"))
67
+ images = pipe.image_to_image(gray[None], "colorize", generator=pipe.generator(0))
68
+ Image.fromarray(images[0]).save("burger.png")
69
+
70
+ # Style transfer of a photo: "anime", "ghibli" or "watercolor"
71
+ photo = load_square("examples/photo_man.jpg")
72
+ images = pipe.image_to_image(photo[None], "watercolor", generator=pipe.generator(0))
73
+ Image.fromarray(images[0]).save("watercolor.png")
74
 
75
+ # Dense prediction: class index, depth in meters and surface normal of every pixel
76
+ room = np.asarray(Image.open("examples/room_1.png").convert("RGB"))
77
+ pred = pipe.dense_predict(room[None]) # {"seg": [B, H, W], "depth": [B, H, W], "normal": [B, H, W, 3]}
78
  ```
79
 
80
+ The repository also has a command-line script for each task and a web demo (`python app.py`). Three public models are
81
+ downloaded on first use, each under its own license: the backbone `Qwen/Qwen3.5-4B`, the tokenizer
82
  `turkeyju/tokenizer_tatitok_bl128_vq` and the CLIP ViT-L/14-336 text tower `timm/vit_large_patch14_clip_336.openai`.
83
 
84
  ## Scope