This file contains hidden or 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
import torch | |
import torch.nn as nn | |
from torch.nn import Linear, Conv2d, BatchNorm1d, BatchNorm2d, PReLU, ReLU, Sigmoid, Dropout, MaxPool2d, \ | |
AdaptiveAvgPool2d, Sequential, Module | |
from collections import namedtuple | |
# Support: ['IR_50', 'IR_101', 'IR_152', 'IR_SE_50', 'IR_SE_101', 'IR_SE_152'] | |
This file contains hidden or 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
_, C2, C3, C4, C5 = resnet_graph(input_image, "resnet50", stage5=True) | |
P5 = KL.Conv2D(256, (1, 1), name='fpn_c5p5')(C5) | |
P4 = KL.Add(name="fpn_p4add")([ | |
KL.UpSampling2D(size=(2, 2), name="fpn_p5upsampled")(P5), | |
KL.Conv2D(256, (1, 1), name='fpn_c4p4')(C4)]) | |
P3 = KL.Add(name="fpn_p3add")([ | |
KL.UpSampling2D(size=(2, 2), name="fpn_p4upsampled")(P4), | |
KL.Conv2D(256, (1, 1), name='fpn_c3p3')(C3)]) | |
P2 = KL.Add(name="fpn_p2add")([ | |
KL.UpSampling2D(size=(2, 2), name="fpn_p3upsampled")(P3), |
This file contains hidden or 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
from keras import backend as K | |
def jaccard_distance_loss(y_true, y_pred, smooth=100): | |
""" | |
Jaccard = (|X & Y|)/ (|X|+ |Y| - |X & Y|) | |
= sum(|A*B|)/(sum(|A|)+sum(|B|)-sum(|A*B|)) | |
The jaccard distance loss is usefull for unbalanced datasets. This has been | |
shifted so it converges on 0 and is smoothed to avoid exploding or disapearing | |
gradient. |
This file contains hidden or 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
lee@lee:~$ sudo apt-get dist-upgrade | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
You might want to run 'apt-get -f install' to correct these. | |
The following packages have unmet dependencies: | |
apport : Depends: python3-apport (>= 2.20.1-0ubuntu2.14) but 2.20.1-0ubuntu2.13 is installed | |
apport-gtk : Depends: python3-apport (>= 2.20.1-0ubuntu2.14) but 2.20.1-0ubuntu2.13 is installed | |
E: Unmet dependencies. Try using -f. |
This file contains hidden or 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
class ResNet_101(object): | |
def __init__(self, inputs, num_classes, phase): | |
self.inputs = inputs | |
self.num_classes = num_classes | |
self.channel_axis = 3 | |
self.phase = phase # train (True) or test (False), for BN layers in the decoder | |
self.build_network() | |
def build_network(self): | |
self.encoding = self.build_encoder() |
This file contains hidden or 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
/JPEGImages/2007_000033.jpg /SegmentationClassAug/2007_000033.png | |
/JPEGImages/2007_000042.jpg /SegmentationClassAug/2007_000042.png | |
/JPEGImages/2007_000061.jpg /SegmentationClassAug/2007_000061.png | |
/JPEGImages/2007_000123.jpg /SegmentationClassAug/2007_000123.png | |
/JPEGImages/2007_000129.jpg /SegmentationClassAug/2007_000129.png | |
/JPEGImages/2007_000175.jpg /SegmentationClassAug/2007_000175.png | |
/JPEGImages/2007_000187.jpg /SegmentationClassAug/2007_000187.png | |
/JPEGImages/2007_000323.jpg /SegmentationClassAug/2007_000323.png | |
/JPEGImages/2007_000332.jpg /SegmentationClassAug/2007_000332.png | |
/JPEGImages/2007_000346.jpg /SegmentationClassAug/2007_000346.png |
This file contains hidden or 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
/JPEGImages/2007_000032.jpg /SegmentationClassAug/2007_000032.png | |
/JPEGImages/2007_000039.jpg /SegmentationClassAug/2007_000039.png | |
/JPEGImages/2007_000063.jpg /SegmentationClassAug/2007_000063.png | |
/JPEGImages/2007_000068.jpg /SegmentationClassAug/2007_000068.png | |
/JPEGImages/2007_000121.jpg /SegmentationClassAug/2007_000121.png | |
/JPEGImages/2007_000170.jpg /SegmentationClassAug/2007_000170.png | |
/JPEGImages/2007_000241.jpg /SegmentationClassAug/2007_000241.png | |
/JPEGImages/2007_000243.jpg /SegmentationClassAug/2007_000243.png | |
/JPEGImages/2007_000250.jpg /SegmentationClassAug/2007_000250.png | |
/JPEGImages/2007_000256.jpg /SegmentationClassAug/2007_000256.png |
This file contains hidden or 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
import tensorflow as tf | |
import numpy as np | |
import os | |
from PIL import Image | |
from dir_traversal_tfrecord import tfrecord_auto_traversal | |
flags = tf.app.flags | |
FLAGS = flags.FLAGS | |
flags.DEFINE_integer("image_number", 186, "Number of images in your tfrecord, default is 186.") |
This file contains hidden or 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
/* | |
RSI - cykedev 14/02/2014 | |
(updated a couple of times since, check git history) | |
*/ | |
// helpers | |
var _ = require('lodash'); | |
var log = require('../core/log.js'); |
This file contains hidden or 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
/* | |
StochRSI - SamThomp 11/06/2014 | |
(updated by askmike) @ 30/07/2016 | |
*/ | |
// helpers | |
var _ = require('lodash'); | |
var log = require('../core/log.js'); |
NewerOlder