Giter Site home page Giter Site logo

fedor-chervinskii / dispflownet-tf Goto Github PK

View Code? Open in Web Editor NEW
28.0 28.0 20.0 710 KB

Tensorflow implementation of https://lmb.informatik.uni-freiburg.de/Publications/2016/MIFDB16

License: MIT License

Jupyter Notebook 95.68% Python 2.90% Shell 0.02% C++ 1.41%

dispflownet-tf's People

Contributors

fedor-chervinskii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

dispflownet-tf's Issues

Python3 fixes

Here's some fixes I need to make to get this to work under python3:

diff --git a/util.py b/util.py
index 19037ad..f05b4c2 100644
--- a/util.py
+++ b/util.py
@@ -16,17 +16,16 @@ def readPFM(file):
     endian = None

     header = file.readline().rstrip()
-    if header == 'PF':
+    if header == b'PF':
         color = True
-    elif header == 'Pf':
+    elif header == b'Pf':
         color = False
     else:
         raise Exception('Not a PFM file.')
-
-    dim_match = re.match(r'^(\d+)\s(\d+)\s$', file.readline())
-    if dim_match:
-        width, height = map(int, dim_match.groups())
-    else:
+    dims = file.readline()
+    try:
+        width,height = list(map(int,dims.split()))
+    except:
         raise Exception('Malformed PFM header.')

In dispnet.py :

-        targets = [tf.image.resize_nearest_neighbor(target, [height / np.power(2, n),
-                                                    width / np.power(2, n)])
+        targets = [tf.image.resize_nearest_neighbor(target, [height // np.power(2, n),
+                                                    width // np.power(2, n)])

And in train.py:

-            schedule_current = min(step / schedule_step, len(weights_schedule)-1)
+            schedule_current = min(step // schedule_step, len(weights_schedule)-1)
-                    schedule_current = min(step / schedule_step, len(weights_schedule)-1)
+                    schedule_current = min(step // schedule_step, len(weights_schedule)-1)

Also MODEL_NAME needs to be set in train.py and not just the ipynb.

shift_corr.so: undefined symbol

hi, I am using the dispnetC, how can I use the Correlation Layer?
I run python train.py and got the following error,
user_ops/shift_corr.so: undefined symbol_: ZN10tensorflow8internal21CheckOpMessageBuilder9NewStringB5cxx11Ev

Correlation layer is not defined correctly

Hi,
I am trying to implement this repository but I see that is a huge discripancy with the reported result on the paper. The result I am getting using this code provide bad result compared the the result reported in the paper. I believe the correlation layer is note defind correctly as below:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
def correlation_map( x, y, max_disp ):
corr_tensors = []
for i in range(-max_disp, 0, 1):
shifted = tf.pad(tf.slice(y, [0, 0, -i, 0], [-1]*4), [[0, 0], [0, 0], [-i, 0], [0, 0]], "CONSTANT")
corr = tf.reduce_mean(tf.multiply(shifted, y), axis=3)
corr_tensors.append(corr)
for i in range(max_disp + 1):
shifted = tf.pad(tf.slice(y, [0]*4, [-1, -1, y.shape[2].value - i, -1]), [[0, 0], [0, 0], [0, i], [0, 0]], "CONSTANT")
corr = tf.reduce_mean(tf.multiply(shifted, y), axis=3)
corr_tensors.append(corr)
return tf.transpose(tf.stack(corr_tensors),perm=[1,2,3,0])
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I see that the x input is ignored while the y input is running over twice!
Could you please clarify this issue because I believe that this is the reason behind this discrepancy.

With best regards,

Essa Anas
Ph.D student

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.