Skip to content

Instantly share code, notes, and snippets.

View jeanpat's full-sized avatar

Pommier jeanpat

View GitHub Profile
@jeanpat
jeanpat / model.py
Created March 19, 2017 10:21 — forked from ndronen/model.py
Semantic segmentation with ENet in PyTorch
#!/usr/bin/env python
"""
A quick, partial implementation of ENet (https://arxiv.org/abs/1606.02147) using PyTorch.
The original Torch ENet implementation can process a 480x360 image in ~12 ms (on a P2 AWS
instance). TensorFlow takes ~35 ms. The PyTorch implementation takes ~25 ms, an improvement
over TensorFlow, but worse than the original Torch.
"""
from __future__ import absolute_import
@jeanpat
jeanpat / generating 82146 lowres.ipynb
Created November 22, 2016 07:42
Generating 82146 examples (greyscaled image+ ground truth label) of overlapping chromosomes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jeanpat
jeanpat / Illumination_correction.ipynb
Created February 10, 2016 17:02
Correction of uneven illumination of images by Top-Hat filtering using opencv 3.1
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jeanpat
jeanpat / graph-tool toy model- Response to pruning-DIP4FISH.ipynb
Created November 6, 2015 02:01
A python notebook proposing a way to compare two graphs with a distance computed from the response of the graphs to the pruning of their leaves
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jeanpat
jeanpat / response_to_pruning.py
Created November 6, 2015 00:27
Apply iterative prunings to a graph until no more vertice of degree 1 remains.
def total_length_graph(graph):
v_ew, _ =vertex_degree1_edge_weight(T)
return np.sum(v_ew.values())
def response_to_iterative_pruning(graph):
'''return the number of vertices of degree 1 as a function of the number of pruning
'''
response = []
response.append((0,number_of_degree1_vertices(graph)))
#print number_of_degree1_vertices(graph)
@jeanpat
jeanpat / pruning.py
Created November 5, 2015 23:55
mainly a fonction pruning an un-directed multigraph
def at_least_one_vertex_of_degree_above_one(graph):
''' check if there's at least one vertex of degree above 1 in the graph.
'''
graph = gt.GraphView(graph, vfilt= lambda v : v.out_degree() > 1)
try:
first = next(graph.vertices())
except StopIteration:
return False
return True
@jeanpat
jeanpat / Toy-graph.py
Created November 5, 2015 23:35
Making a weighted graph with graph-tool
def make_toy_graph():
T = gt.Graph(directed = False)
edge_weights = T.new_edge_property('double')
T.properties[("e","weight")] = edge_weights
T.add_vertex(n=4)
e_1 = T.add_edge(0,1)
e_2 = T.add_edge(1,2)
e_3 = T.add_edge(0,0)
@jeanpat
jeanpat / graph-tool toy model.ipynb
Created October 6, 2015 22:16
Getting the vertices of degree 1 and reading the weight of the bound edge using graph-tool (ipython notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jeanpat
jeanpat / Blob detection.ipynb
Created September 2, 2015 23:30
Blobs detection with mahotas
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.