Code Monkey home page Code Monkey logo

Comments (2)

deqings avatar deqings commented on August 11, 2024 2

Thanks for your interest in our work. We performed the experiment using the AutoFlow training pipeline, which differs from the official PyTorch implementation of RAFT, esp. regarding data augmentation.
Could you please refer to the AutoFlow codebase?
https://github.com/google-research/opticalflow-autoflow
(Right now the data augmentation code is available, and the full training pipeline will be available very soon.)

from kubric.

DQiaole avatar DQiaole commented on August 11, 2024

Hello, sorry to bother @aqluheng @deqings .
I am also interested in MOVI-F dataset recently, but after checking the data by using flow to warp image t+1, I found there is some objects are labeled with wrong flow. Would you give any advice about this? Following figure shows the warping results, from left to right: image t, warpped image t+1 by forward flow, image t within region of interest, warpped image t+1 within region of interest, image t+1.
(Please pay attention to the blue shoe)
a

The codes I used are also here:

import tensorflow_datasets as tfds
def backwarp(tenInput, tenFlow):
    tenHorizontal = torch.linspace(-1.0, 1.0, tenFlow.shape[3]).view(1, 1, 1, tenFlow.shape[3]).expand(tenFlow.shape[0], -1, tenFlow.shape[2], -1)
    tenVertical = torch.linspace(-1.0, 1.0, tenFlow.shape[2]).view(1, 1, tenFlow.shape[2], 1).expand(tenFlow.shape[0], -1, -1, tenFlow.shape[3])

    coord = torch.cat([ tenHorizontal, tenVertical ], 1)

    tenFlow = torch.cat([ tenFlow[:, 0:1, :, :] / ((tenInput.shape[3] - 1.0) / 2.0), tenFlow[:, 1:2, :, :] / ((tenInput.shape[2] - 1.0) / 2.0) ], 1)
 
    return torch.nn.functional.grid_sample(input=tenInput, grid=(coord + tenFlow).permute(0, 2, 3, 1), mode='bilinear', padding_mode='border', align_corners=True)


ds, ds_info = tfds.load("movi_f/512x512", data_dir="./", with_info=True)
train_iter = iter(tfds.as_numpy(ds["train"]))
example = next(train_iter)
example = next(train_iter)  # the example I provided is the sencod data in train_iter
minv, maxv = example["metadata"]["forward_flow_range"]
forward_flow = example["forward_flow"][0] / 65535 * (maxv - minv) + minv
img0, img1 = example["video"][:2]
mask = np.sum(forward_flow**2, axis=-1)[:,:,None]
warpimg1 = backwarp(torch.tensor(example["video"][1][None, :, :, :]).permute(0, 3, 1, 2).float(), torch.tensor(forward_flow[None, :, :, :]).permute(0, 3, 1, 2).float())
warpimg1 = warpimg1[0].permute(1,2,0).numpy()
img = np.concatenate([img0, warpimg1, img0 * (mask>1), warpimg1 * (mask>1), img1], axis=1)

By the way, have you succeeded in replicating the results in the paper? @aqluheng

from kubric.

Related Issues (20)

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.