Skip to content

Commit

Permalink
extra comments, slight reformatting
Browse files Browse the repository at this point in the history
Added extra comments with some more details,
Changed backend to auto,
changed votemode to WEIGHTED for sharper results,
included example for more than 2 guides,
added more info to README.md
  • Loading branch information
Trentonom0r3 committed Aug 6, 2023
1 parent ac21bf3 commit 11fc80b
Show file tree
Hide file tree
Showing 16 changed files with 466 additions and 328 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#Don't commit these files to git
#The Main Library
*.dll

#The Zipped Library
*.zip

#The Dist Folder from building
/dist/

#The Build Folder from building
/build/
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ebsynth/ebsynth.dll
28 changes: 24 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,37 @@ Ebsynth as an importable python library!

This is quite a simple implementation. I'll be working to add more complex classes and options in the future.

Using the class provided, you can perform things like style transfer, color transfer, inpainting, superimposition, and more!
I will be providing some examples of te different use cases in coming days, for now Ive included a few example scripts for a basic stylization.

# Table of Contents
- [Table of Contents](#table-of-contents)
- [Installation](#installation)
- [Notes](#notes)
- [Class Definition](#class-definition)
- [Example Usage](#example-usage)

## Installation!

```
pip install ezsynth
```

## Notes
- Default usage is with CUDA. Pass CPU to backend if you don't have CUDA.
- Default usage is set to 'Auto'. Pass CPU to backend if you don't have CUDA.
- I compiled the .dll to be compatible with compute 6.0 GPUs and up, let me know if you have any issues please.
- Pass file paths OR numpy arrays directly!
- <Style> should be the image style you're trying to achieve.
- In the context of frame stylization, this should be the stylized version of a certain frame.
> You could then stylize the next frame using your single style frame. A simple example is as follows:

## Class Definition:
```
ebsynth = ebsynth.ebsynth(style='frame1_stylized.png', guides=[('frame1.png', 'frame2.png')])
result_img = ebsynth.run()
```


## Class Definition:

```
class ebsynth:
Expand Down Expand Up @@ -163,8 +180,10 @@ import cv2
# Define the paths to the images
style_image_path = "style.png"
guide_pairs = [
("guide1.png", "target2.png"),
("guide2.png", "Target2.png")
("guide1.png", "target1.png"),
("guide2.png", "target2.png"),
("guide3.png", "target3.png"),
("guide4.png", "target4.png")
]

# Create an instance of the EBSynth class with multiple guide pairs
Expand All @@ -178,4 +197,5 @@ cv2.imwrite("output.png", result_img)
cv2.imshow("Styled Image with Multiple Guides", result_img)
cv2.waitKey(0)
cv2.destroyAllWindows()

```
Binary file removed dll.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions __init__.py → ebsynth/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from .ebsynth import ebsynth
from ._ebsynth import run, EBSYNTH_BACKEND_CPU, EBSYNTH_BACKEND_CUDA, EBSYNTH_BACKEND_AUTO
from .ebsynth import ebsynth
from ._ebsynth import run, EBSYNTH_BACKEND_CPU, EBSYNTH_BACKEND_CUDA, EBSYNTH_BACKEND_AUTO
Loading

0 comments on commit 11fc80b

Please sign in to comment.