fin-ger / color-harmonization

Mirrored from gitlab
GNU General Public License v2.0
4 stars 1 forks source link

Lots of error on make run #1

Open RichardoTiono opened 4 years ago

RichardoTiono commented 4 years ago

Hello, could you help with the make run installation? so far I have to remove silent import from mypy in order to progress forward and I got a bunch of error. I could give a list the error if you can help with it.

fin-ger commented 4 years ago

You can paste the error messages here, however the code is very slow and not finished yet. There are some bugs in the color shifting. I currently do not have the time to maintain the project actively. I will try to provide you with hints on the error messages, but please don't be disappointed if the response takes some days :see_no_evil:

RichardoTiono commented 4 years ago

Hi, I already appreciate very much that you would reply and help me since I plan to use this on my research and even if it is not perfect as long as it can run I think it would be plenty helpful for me. Ok so these are part of the installation that has error on it, I believe some package are already installed on my conda environment like for example numpy yet it still come up as error

Compiling internationalization files... Building python package... color_harmonization/gui/gl_widget.py:21: error: No library stub file for module 'gi.repository' color_harmonization/gui/gl_widget.py:22: error: Cannot find implementation or library stub for module named 'OpenGL' color_harmonization/gui/init.py:19: error: Name 'List' is not defined color_harmonization/gui/init.py:19: note: Did you forget to import it from "typing"? (Suggestion: "from typing import List") color_harmonization/init.py:19: error: Name 'List' is not defined color_harmonization/init.py:19: note: Did you forget to import it from "typing"? (Suggestion: "from typing import List") color_harmonization/handler.py:20: error: No library stub file for module 'gi.repository' color_harmonization/gui/hue_sat_wheel_widget.py:20: error: No library stub file for module 'numpy' color_harmonization/gui/hue_sat_wheel_widget.py:22: error: Cannot find implementation or library stub for module named 'cairocffi' color_harmonization/gui/hue_sat_wheel_widget.py:25: error: No library stub file for module 'gi.repository' color_harmonization/gui/gl_quad_renderer.py:19: error: No library stub file for module 'numpy' color_harmonization/gui/gl_quad_renderer.py:23: error: Cannot find implementation or library stub for module named 'OpenGL' color_harmonization/gui/gl_quad_renderer.py:24: error: Cannot find implementation or library stub for module named 'pyrr' color_harmonization/gui/gl_quad_renderer.py:25: error: No library stub file for module 'PIL' color_harmonization/gui/gl_image.py:19: error: No library stub file for module 'gi.repository' color_harmonization/gui/assistant.py:24: error: No library stub file for module 'gi.repository' color_harmonization/gui/assistant.py:24: note: (Stub files are from https://github.com/python/typeshed) color_harmonization/gui/assistant.py:39: error: Module has no attribute "bindtextdomain" color_harmonization/gui/assistant.py:104: error: Incompatible types in assignment (expression has type "None", variable has type "List[str]") color_harmonization/gui/assistant.py:105: error: Incompatible types in assignment (expression has type "None", variable has type "str") color_harmonization/main.py:22: error: Cannot find implementation or library stub for module named 'gi' color_harmonization/main.py:22: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports Found 18 errors in 9 files (checked 12 source files) Makefile:33: recipe for target 'build' failed

I hope that you can give me direction on how to solve it

fin-ger commented 4 years ago

Have you tried running make init before doing make run?

Also, this software was designed to run on a Gnome GNU/Linux distribution only and makes use of the gobject-introspection (gi) and GTK. In order for the application to run, you will need at least a working GTK setup. I don't know if it's actually possible to make it work on anything else but Gnome...

RichardoTiono commented 4 years ago

I didn't run make init before doing make run. I will try it. I am working on ubuntu desktop. I will see if there are other way to install GTK on it

RichardoTiono commented 4 years ago

So I have tried do run make init first and everything is successfully installed but when I run make run the same error still come out. Does this mean it is not possible to use it ubuntu?

fin-ger commented 4 years ago

It should work on ubuntu, as it is a Gnome GNU/Linux Distribution

fin-ger commented 4 years ago

What happens if you just run

/usr/bin/env python3 -m color_harmonization

In your terminal?

RichardoTiono commented 4 years ago

When I tried to run it, it says

./color_harmonization$ dir color_harmonization LICENSE Makefile README.md requirements.txt ./color_harmonization$ /usr/bin/env python3 -m color_harmonization/ /home/cgal/anaconda3/envs/color/bin/python3: No module named color_harmonization/

I don't quite what your instruction is since there are no module named color_harmonization even inside those folder.

fin-ger commented 4 years ago

The module is the color_harmonization folder with a __init__.py located inside it. I will try it in an ubuntu container and see if I can get it working

fin-ger commented 4 years ago

I was able to get it running in a fresh ubuntu installation:

$ export PATH="$PATH:$HOME/.local/bin"
$ sudo apt install git build-essential python3 python3-pip gettext python3-gi \
    gobject-introspection gir1.2-gtk-3.0 python3-opengl python3-cairo
$ # uncomment mypy from Makefile
$ make run SHELL=/bin/bash

I apologize for the shitty makefile.

RichardoTiono commented 4 years ago

Hi, did you use the same makefile as in the code? I already tried your instruction above but the error still the same. I also cant find any mypy that can be uncommented on the Makefile. Is there any possibilities that I fail because of using newer version of the requirement for ex: my numpy is 1.17.2 and Pillow is 6.2.0

RichardoTiono commented 4 years ago

Ok so I tried again after downgrading pycairo to 1.11.0 and run it directly using

/usr/bin/env python3 -m color_harmonization

since make run still doesn't work me and it works now. I think I accidentally add / before. Anyway I was able to run it until the end but seems like the harmonizing part doesn't work. No matter what configuration I chose, it doesn't has any effect on the harmonized image including automatic configuration. Can you give direction on where the problem is?

And so far as I concern you have been very helpful to me since you have spared your time to help me this far. Once again I express my gratitude for you

fin-ger commented 4 years ago

This might be an implementation bug with the opengl code. I used a fragment shader to shift the colors. Maybe the harmonization data is not correctly uploaded to the GPU.

In general, it was a bad idea to use opengl here. It adds a lot of complexity to the code with little to no benefit. You might have better results with using a python image manipulation library directly.

RichardoTiono commented 4 years ago

Ok thank you for your advice