d95f630a7b7f88621bc4abb4ac92692647f03781,main.py,,flow2rgb,#,339

Before Change


        normalized_flow_map = flow_map / (np.abs(flow_map).max())
    rgb_map[:,:,0] += normalized_flow_map[0]
    rgb_map[:,:,1] -= 0.5*(normalized_flow_map[0] + normalized_flow_map[1])
    rgb_map[:,:,2] += normalized_flow_map[1]
    return rgb_map.clip(0,1)

After Change




def flow2rgb(flow_map, max_value):
    flow_map_np = flow_map.detach().cpu().numpy()
    _, h, w = flow_map_np.shape
    flow_map_np[:,(flow_map_np[0] == 0) & (flow_map_np[1] == 0)] = float("nan")
    rgb_map = np.ones((3,h,w)).astype(np.float32)
    if max_value is not None:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: ClementPinard/FlowNetPytorch
Commit Name: d95f630a7b7f88621bc4abb4ac92692647f03781
Time: 2018-08-23
Author: clement.pinard@parrot.com
File Name: main.py
Class Name:
Method Name: flow2rgb


Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: 21fa4e7e38567e083f98c559f8f2ae0c5573ba0f
Time: 2018-02-11
Author: max.lapan@gmail.com
File Name: ch15/lib/model.py
Class Name: AgentA2C
Method Name: __call__


Project Name: havakv/pycox
Commit Name: 190d9b204a1a4798f0723c8d8d37ac5ac950909e
Time: 2019-05-08
Author: haavard.kvamme@gmail..com
File Name: pycox/models/deephit.py
Class Name: DeepHitSingle
Method Name: predict_survival_function