Skip to content
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

Google Colab version #3

Open
cedro-3 opened this issue Dec 19, 2020 · 6 comments
Open

Google Colab version #3

cedro-3 opened this issue Dec 19, 2020 · 6 comments

Comments

@cedro-3
Copy link

cedro-3 commented Dec 19, 2020

Would you please publish the Google Colab version?
I think that if you have the Google Colab version, you can appeal to more people.

@benearnthof
Copy link

For future reference: All that is needed to run this repository in Google Colab is to remove or comment out all the calls to cv2.imshow, since you can't open external windows in Colab. I've forked this repo and added these changes. You can find a minimal version of running the cat script here:
https://colab.research.google.com/drive/1TCKZg3FxJepnmcZE7Xjef6_BHmvzdmbb?usp=sharing
If you want to process your own images simply upload them with a unique name to the 'input' directory and change the variable name in the corresponding script. For example:
Upload 'yourimage.png' to the 'input' directory
If we would like to use 'process_order.py' we change the args line in the file from

# args
input_path = './input/your file'

to

# args
input_path = './input/yourimage.png'

and run
!python process_order.py
in a code cell after saving the changes. You can, of course, also change the parameters to your liking.
The output images will be located in the 'output' directory in their own folder.

@cedro-3
Copy link
Author

cedro-3 commented Jan 3, 2021 via email

@goodwin74
Copy link

I tried to make my own Colab notepad first, but got an error. I saw this thread and tried to run the above mentioned Colab. But there is the same error. What to do?

ETF/edge_tangent_flow.py", line 12, in init
self.origin_shape = img.shape
AttributeError: 'NoneType' object has no attribute 'shape'

@benearnthof
Copy link

I tried to make my own Colab notepad first, but got an error. I saw this thread and tried to run the above mentioned Colab. But there is the same error. What to do?

ETF/edge_tangent_flow.py", line 12, in init
self.origin_shape = img.shape
AttributeError: 'NoneType' object has no attribute 'shape'

the img object created by the cv2.imread function in the code you mentioned is supposed to return an image. The Error you encountered means that cv2.imread must have returned nothing or an object of type "NoneType". So I suspect you're trying to read images in the wrong file format. Try the stuff suggested here: and see what the cv2.imread function returns.

@goodwin74
Copy link

I tried to make my own Colab notepad first, but got an error. I saw this thread and tried to run the above mentioned Colab. But there is the same error. What to do?

ETF/edge_tangent_flow.py", line 12, in init
self.origin_shape = img.shape
AttributeError: 'NoneType' object has no attribute 'shape'

the img object created by the cv2.imread function in the code you mentioned is supposed to return an image. The Error you encountered means that cv2.imread must have returned nothing or an object of type "NoneType". So I suspect you're trying to read images in the wrong file format. Try the stuff suggested here: and see what the cv2.imread function returns.

Thanks! Is it possible to generate one final image? Is it possible to turn off the animation so as not to waste extra resources and speed up drawing?

@benearnthof
Copy link

benearnthof commented Feb 7, 2022

Thanks! Is it possible to generate one final image? Is it possible to turn off the animation so as not to waste extra resources and speed up drawing?

The relevant line controlling this in the process_order.py file can be found here the Freq variable controls how frequently images are saved. If you set Freq to the total number of iterations only one final image should be generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants