scivision / pyoptflow

Optical Flow estimation in pure Python
Apache License 2.0
76 stars 19 forks source link

Couldn't run the script #1

Closed lahiiru closed 6 years ago

lahiiru commented 7 years ago
  File "HornSchunck.py", line 22
    fn1 = f'{stem}.{i}{ext}'
                           ^
SyntaxError: invalid syntax

Above error appears when python HornSchunck.py data/box/box. Tested in Windows and Ubuntu, python 2.7

drhirsch commented 7 years ago

Yes this is current Python (>= 3.6) string syntax

lahiiru commented 7 years ago

Thanks. Managed to fix using string.format()

wrat commented 7 years ago

@lahiiru
I am facing same problem , can you give me fix code snippet here ???

scivision commented 7 years ago

I can change this to Python<3.6 format tonight. Thanks

wrat commented 7 years ago

@scivision have you changed the code ???

lahiiru commented 7 years ago

@wrat

fn1 = "{0}.{1}{2}".format(stem,i,ext)

replace other lines also accordingly.

wrat commented 7 years ago

@lahiiru after changing this it's showing another error File "LucasKanade.py", line 11, in from pyoptflow import LucasKanade, getPOI, gaussianWeight File "/home/abhishek/pyoptflow-master/pyoptflow/init.py", line 74 Vpt = np.linalg.inv(A.T @ W2 @ A) @ A.T @ W2 @ B ^ SyntaxError: invalid syntax ??

lahiiru commented 7 years ago

@wrat

Then replace pyoptflow/init.py", line 74 to Vpt = np.linalg.inv(A.T.dot(W**2).dot(A)).dot(A.T).dot(W**2).dot(B)

see the meaning of @ operator

scivision commented 7 years ago

This has been updated to version "1.1.0" which is Python >= 3.5 compatible