MCPcopy Create free account
hub / github.com/drinkingcoder/FlowFormer-Official / chrom_aug

Method chrom_aug

core/utils/flow_transforms.py:425–438  ·  view source on GitHub ↗
(self, rgb)

Source from the content-addressed store, hash-verified

423 return inputs,target
424
425 def chrom_aug(self, rgb):
426 # color change
427 mean_in = rgb.sum(-1)
428 rgb = rgb*self.color[np.newaxis,np.newaxis]
429 brightness_coeff = mean_in / (rgb.sum(-1)+0.01)
430 rgb = np.clip(rgb*brightness_coeff[:,:,np.newaxis],0,1)
431 # gamma
432 rgb = np.power(rgb,self.gamma)
433 # brightness
434 rgb += self.brightness
435 # contrast
436 rgb = 0.5 + ( rgb-0.5)*self.contrast
437 rgb = np.clip(rgb, 0, 1)
438 return

Callers 1

__call__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected