not-lain commited on
Commit
0ac40ca
1 Parent(s): 1e008dd

Update README.md

Browse files

this will add a code snippet to the readme file (since custom pipelines are not a thing yet and my pr about adding `push_to_hub` method to pipelines is still on review for the past 4 months at https://github.com/huggingface/transformers/pull/29172)

============================
I did not mention that they should install loadimg in the readme via
```
pip install loadimg
```
because i am not sure if you want to keep it or not, loadimg is a python package that I created to load images of any type and convert them, it currently supports pil, numpy, str (path), str urls (including normal urls, drive urls, github urls, and huggingface urls ), if you chose to remove loadimg, don't forget to directly update your file at `MangaPipe.py`, there are no other changes required so it should be straight forward.
happy coding ✨✨

Files changed (1) hide show
  1. README.md +8 -0
README.md CHANGED
@@ -37,6 +37,14 @@ with torch.no_grad():
37
  line_image = Image.fromarray(outputs.pixel_values[0].numpy().astype("uint8"), mode="L")
38
  line_image.save("./line_image.png")
39
  ```
 
 
 
 
 
 
 
 
40
 
41
  |`sample.jpg`|Generated line image|
42
  |-|-|
 
37
  line_image = Image.fromarray(outputs.pixel_values[0].numpy().astype("uint8"), mode="L")
38
  line_image.save("./line_image.png")
39
  ```
40
+ or you can use the pipeline
41
+
42
+ ```py
43
+ from transformers import pipeline
44
+
45
+ pipe = pipeline("image-to-image", model="p1atdev/MangaLineExtraction-hf", trust_remote_code=True)
46
+ pipe("sample.jpg")
47
+ ```
48
 
49
  |`sample.jpg`|Generated line image|
50
  |-|-|