fedor-chervinskii / dispflownet-tf Goto Github PK
View Code? Open in Web Editor NEWTensorflow implementation of https://lmb.informatik.uni-freiburg.de/Publications/2016/MIFDB16
License: MIT License
Tensorflow implementation of https://lmb.informatik.uni-freiburg.de/Publications/2016/MIFDB16
License: MIT License
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_module = tf.load_op_library(os.path.join(REPO_DIR, 'user_ops/shift_corr.so'))
It can't load the library which is shift_corr.so.
Is the tensorflow version cause the issue?
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
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.