Skip to content

Instantly share code, notes, and snippets.

View aboucaud's full-sized avatar

Alexandre Boucaud aboucaud

View GitHub Profile
@aboucaud
aboucaud / score_with_mask_image.ipynb
Last active May 4, 2020 12:31
Crater detection score #ramp #visualisation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aboucaud
aboucaud / interactive_scoring.ipynb
Last active May 4, 2020 12:30
Interactive scoring of 2 craters #ramp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aboucaud
aboucaud / get_contours.ipynb
Last active May 4, 2020 12:33
Galaxy contours #astro #visualisation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aboucaud
aboucaud / keras_hardware_config.py
Created March 22, 2018 13:30
Limit hardware usage with Keras and TensorFlow
from keras import backend as K
num_cores = 4
num_GPU = 1
num_CPU = 1
config = K.tf.ConfigProto(
intra_op_parallelism_threads=num_cores,
inter_op_parallelism_threads=num_cores,
allow_soft_placement=True,
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aboucaud
aboucaud / setup_ramp_on_aws.sh
Last active May 4, 2020 12:31
Setup a RAMP backend architecture for a given RAMP project #ramp #config
#!/bin/bash
#
# Setup a RAMP backend architecture for a given RAMP project
set -e
# Script help
usage()
{
echo "
@aboucaud
aboucaud / py3k_image_downloader.py
Last active September 10, 2024 18:27
Download images from urls given in a CSV file
# !/usr/bin/python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------------------------
# Original script from @anokas: https://www.kaggle.com/anokas/py3-image-downloader-w-progress-bar
# -----------------------------------------------------------------------------------------------
# Note: requires the tqdm package (pip install tqdm)
# Note to Kagglers: This script will not run directly in Kaggle kernels. You

Keybase proof

I hereby claim:

  • I am aboucaud on github.
  • I am aboucaud (https://keybase.io/aboucaud) on keybase.
  • I have a public key whose fingerprint is EDD1 74D9 AC29 33A9 0778 84D8 80EF DA9F C744 ED5C

To claim this, I am signing this object:

@aboucaud
aboucaud / plot_colors_from_colormap.py
Last active May 4, 2020 11:20
Extract colors from matplotlib colormap #python #visualisation
import numpy as np
import matplotlib.pyplot as plt
N = 10
colors = plt.cm.viridis(np.linspace(0.25, 1.0, N))
x = np.linspace(0, 1, 30)
powers = np.arange(N) + 1
for power, color in zip(powers, colors):
@aboucaud
aboucaud / pandas_table_style.py
Last active May 13, 2020 17:24
[Pandas table styling] #python #visualisation
# https://pandas.pydata.org/pandas-docs/stable/reference/style.html
# https://towardsdatascience.com/style-pandas-dataframe-like-a-master-6b02bf6468b0
import pandas as pd
# Option examples
pd.set_option('precision', 4)
pd.set_option('max_rows', 10)
pd.set_option('max_columns', 7)
pd.set_option("display.max_colwidth", -1)