56156540d33f329ebf271ac9313ca723e649c0a2,kraken/blla.py,,segment,#Any#Any#Any#Any#,44
Before Change
im = im.rotate(angle, expand=True)
a = pil2array(im)
binary = np.array(a > 0.5*(np.amin(a) + np.amax(a)), "i")
binary = 1 - binary
if mask:
if mask.mode != "1" and not is_bitonal(mask):
logger.error("Mask is not bitonal")
After Change
transforms = dataset.generate_input_transforms(batch, height, width, channels, 0, valid_norm=False)
with torch.no_grad():
o = model.nn(transforms(im).unsqueeze(0))
o = F.interpolate(o, size=im.size[::-1])
o = segmentation.denoising_hysteresis_thresh(o.detach().squeeze().cpu().numpy(), 0.4, 0.5, 0)
baselines = segmentation.vectorize_lines(o)
polygons = segmentation.calculate_polygonal_environment(im, baselines)
return polygons
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: mittagessen/kraken
Commit Name: 56156540d33f329ebf271ac9313ca723e649c0a2
Time: 2019-06-27
Author: mittagessen@l.unchti.me
File Name: kraken/blla.py
Class Name:
Method Name: segment
Project Name: dpressel/mead-baseline
Commit Name: da1e8c2de9b265dcb18256a0a087165faf138b42
Time: 2019-01-14
Author: blester125@users.noreply.github.com
File Name: python/baseline/pytorch/seq2seq/model.py
Class Name: EncoderDecoderModelBase
Method Name: predict
Project Name: open-mmlab/mmdetection
Commit Name: e421e832883241bd7831bf77dc31d5fb31d7da58
Time: 2019-04-06
Author: chenkaidev@gmail.com
File Name: mmdet/ops/nms/nms_wrapper.py
Class Name:
Method Name: nms