-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Necessary steps to reintegrate BSRGANx2 #40
Comments
Sorry, I realize now that I did encounter problems at one point when I set |
Hi my friend, i resolved the problem just yeasterday! Thank you :D It will be reintroduced in next release :) |
That's great news! Thank you so much for your hard work. 😄 If you are open to suggestions for the next version, may I suggest adding a window title, and allowing images to be dragged and dropped into the application again? Otherwise, let me know if you are open for PRs on these after the next release. 😄 Thank you! |
Thank you my friend ❤️ Unfortunately customtkinter doesn't support any kind of drag&drop, I'm also following a thread on github about it but I don't see any development :( |
I was able to get drag and drop working, although I haven't fully implemented it in a usable state yet. The trick is to use class Tk(CTk, TkinterDnD.DnDWrapper):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.TkdndVersion = TkinterDnD._require(self) Then, replace your window line with this: window = Tk(); With this alone, the app will continue working as before. However, you can now listen for drag and drop on something like the def get_path(event):
print(event.data)
def place_up_background():
up_background = CTkLabel(master = window,
text = "",
fg_color = dark_color,
font = bold12,
anchor = "w")
up_background.place(relx = 0.5,
rely = 0.0,
relwidth = 1.0,
relheight = 1.0,
anchor = tk.CENTER)
up_background.drop_target_register(DND_ALL)
up_background.dnd_bind("<<Drop>>", get_path) Now, the drop cursor is displayed, and dropping a file will successfully print the file path. Does that help? Perhaps this is worth its own issue, if you'd like me to open one for more exploration. |
Thank you, I will look into it 😄 |
Hi,
I've been investigating the problems you were facing with BSRGANx2 and I believe the flaw is actually with your code, not the model or torchml version. I managed to get it working again with the old BSRGANx2.pth file.
Step 1: Removing
upconv2
The BSRGANx2 model does not contain the
upconv2
dimension, but your code currently always looks for it. Commenting these lines out while using the BSRGANx2 model allowed it to work properly.Solution: Alter these if statements to also check if the model is != BSRGANx2.
Step 2: Reducing scaling multipliers
The latest version hardcodes the multipliers for
* 4
for example insidefix_tile_shape
andget_final_image_shape
. We must instead change this to* 2
when using BSRGANx2.That's all, it's working fine for me now. Please let me know if you need assistance, and I am very much looking forward to BSRGANx2 being added again! 🎉
The text was updated successfully, but these errors were encountered: