Skip to content

Instantly share code, notes, and snippets.

View ZekunZh's full-sized avatar

Zekun ZHANG ZekunZh

  • Gleamer.ai
  • PARIS, FRANCE
  • 00:46 (UTC +02:00)
View GitHub Profile
@ZekunZh
ZekunZh / Install NVIDIA Driver and CUDA.md
Last active November 5, 2018 15:11 — forked from zhanwenchen/Install NVIDIA Driver and CUDA.md
Install NVIDIA CUDA 9.0 on Ubuntu 16.04.4 LTS
@ZekunZh
ZekunZh / Clone original github repo, then change to the forked repo
Created November 15, 2018 10:06
Clone original github repo, then change to the forked repo
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy.
* Off the top of my head *
1. Fork their repo on Github
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
git remote add my-fork git@github...my-fork.git
@ZekunZh
ZekunZh / image_augmentation.py
Created November 22, 2018 11:23
Image augmentation on top of classical affine augmentations
class ImageBaseAug(object):
def __init__(self):
sometimes = lambda aug: iaa.Sometimes(0.5, aug)
self.seq = iaa.Sequential(
[
# Blur each image with varying strength using
# gaussian blur (sigma between 0 and 3.0),
# average/uniform blur (kernel size between 2x2 and 7x7)
# median blur (kernel size between 3x3 and 11x11).
iaa.OneOf([
@ZekunZh
ZekunZh / verify_input_images_before_long_train.md
Last active November 26, 2018 18:01
One important lesson: Always verify input images of NN before starting a long train !

One important lesson: Always verify input images of NN before starting a long train !

Lesson 1: always verify input training images before you run a long training !

Lesson 2: always verify train losses during training !

Lesson 3: always verify predicted bboxes during evaluation !

Lesson 4: the devil lies in the smallest details, do not overlook small but meaningful signals !

az vm create --resource-group bushi-RG1 \
--name glm-bushi-2 --nics bushi-nic-2 \
--size Standard_DS1_v2 --os-type Linux \
--attach-os-disk glm-bushi-2 --attach-data-disks glm-bushi-disk-2 --plan-name linuxdsvmubuntu --plan-product linux-data-science-vm-ubuntu --plan-publisher microsoft-ads
@ZekunZh
ZekunZh / bodyparts.md
Last active November 30, 2018 13:37
A reasonable defination of interesting body parts for bone fractures

VALID_PARTS = ['ANKLE', 'ARM', 'CLAVICLE', 'ELBOW', 'FINGER', 'FOOT', 'FOREARMBONE', 'HAND', 'HIP', 'HUMERUS', 'KNEE', 'LEG', 'PATELLA', 'PELVIS', 'SHOULDER', 'WRIST']

Remove PELVIS and HIP for now, because of the limitation of images

ls | parallel -n2000 mkdir {#}\;mv {} {#}

-n2000 takes 2000 arguments at a time and {#} is the sequence number of the job.

Start from FP/FN

  1. For FP, find a sweet point of confidence threshold that corresponds to X (X=0.3) mean FP/study, in order to predict the bboxes that are possible missings in GT.

    Note : confidence threshold up -> mean FP/study down -> total FP down -> less time & effort, but can miss more good preds

  2. For FN, find a sweet point of confidence threshold that corresponds to X (X=?) mean FN/study, in order to show the GTs that are not detected / badly detected by the model.

from subprocess import call
call(["nvidia-smi", "--format=csv", "--query-gpu=index,name,driver_version,memory.total,memory.used,memory.free"])

Git submodule: kézako ? (https://fr.wiktionary.org/wiki/qu%C3%A9saco#fr) On rajoute un dossier dans le repository parent qui est un autre repository git. Chaque nouveau commit du repo parent va désormais référencer un commit du repo inclus précis, pour garantir la cohérence de l’état permanent. Le commit de référence peut être sur n’importe quelle branche.

Attention

  • quand on revient à un état ancien (vieux commit du parent) il faut assurer la synchro en forçant la mise en cohérence du submodule.

  • Le submodule est dans un état particulier (detached HEAD), avant de commit dessus il faut s’assurer de ne pas être dans ce mode (checkout de la branche courante)

##########################################################################