This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Package Version | |
------------------------ -------------------- | |
argcomplete 2.0.0 | |
arrow 1.2.2 | |
attrs 19.3.0 | |
Automat 0.8.0 | |
binaryornot 0.4.4 | |
blinker 1.4 | |
certifi 2019.11.28 | |
chardet 3.0.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def wb_mask(img, y_pred, y_true): | |
labels = { | |
0: 'normal', | |
1: 'anomaly' | |
} | |
return wandb.Image(img, masks={ | |
'prediction' : {'mask_data' : y_pred, 'class_labels' : labels}, | |
'ground truth' : {'mask_data' : y_true, 'class_labels' : labels}}) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def extract_patches(x,): | |
ksizes = [1, PATCH_WIDTH, PATCH_HEIGHT, 1] | |
strides = [1, 16, 16, 1] | |
rates = [1, 1, 1, 1] | |
padding = 'SAME' | |
return tf.image.extract_patches(x, ksizes, strides, rates, padding) | |
def extract_patches_inverse(x, y, tape): | |
_x = tf.zeros_like(x) | |
_y = extract_patches(_x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension NSString { | |
func stringByConvertingHexToUnicode() -> NSString { | |
var replaced = "" | |
var scanned: NSString? | |
let scanner = NSScanner(string: self as String) | |
while !scanner.atEnd { | |
if scanner.scanUpToString("0x", intoString: &scanned), let s = scanned { | |
replaced.appendContentsOf(s as String) | |
} |