Skip to content

Instantly share code, notes, and snippets.

View Kraego's full-sized avatar
:octocat:
Back @ work

Thomas Kraxner Kraego

:octocat:
Back @ work
View GitHub Profile
@ilmonteux
ilmonteux / segmentation_metrics.py
Last active March 31, 2025 19:32
Semantic segmentation metrics in Keras and Numpy. IoU, Dice in both soft and hard variants. Mean metrics for multiclass prediction. See https://ilmonteux.github.io/2019/05/10/segmentation-metrics.html for discussion
import numpy as np
import keras.backend as K
import tensorflow as tf
def metrics_np(y_true, y_pred, metric_name, metric_type='standard', drop_last = True, mean_per_class=False, verbose=False):
"""
Compute mean metrics of two segmentation masks, via numpy.
IoU(A,B) = |A & B| / (| A U B|)
Dice(A,B) = 2*|A & B| / (|A| + |B|)
@chriscandy
chriscandy / install-arch-linux-using-efi-and-grub.md
Last active February 1, 2026 20:31
Install Arch Linux using EFI and GRUB

Installing Arch linux with EFI

  1. Change keyboard layout:

    • loadkeys no
  2. Verify boot mode:

    • ls /sys/firmware/efi/efivars (If the directory exist your computer supports EFI)
  3. Ping some site on the Internet to verify connection:

  • ping archlinux.org