Skip to content

Instantly share code, notes, and snippets.

View serycjon's full-sized avatar

Jonas Serych serycjon

  • Prague, Czech Republic
View GitHub Profile
@serycjon
serycjon / telegram_notification.py
Created April 8, 2021 15:05
Telegram notification on fail
import traceback
import time
def with_telegram(orig_fn):
start = time.time()
try:
import telegram_send
def push_msg_fn(msg):
@serycjon
serycjon / flow_vis.py
Last active October 4, 2019 15:04
Optical flow visualization
import numpy as np
import cv2
from vis_utils import cv2_hatch
def show_flow(flow, src_img, dst_img, grid_sz=10,
occl=None, occl_thr=255,
arrow_color=(0, 0, 255),
point_color=(0, 255, 255),
occlusion_color=(217, 116, 0),
decimal_places=2):
@serycjon
serycjon / filter_events.py
Created September 20, 2018 09:33
Filter tensorflow event files
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import argparse
import tqdm
import tensorflow as tf
// compute intersection area
std::vector<cv::Point2f> intersections_unsorted;
std::vector<cv::Point2f> intersections;
cv::rotatedRectangleIntersection(bounding_rect, detection_bbox, intersections_unsorted);
if (intersections_unsorted.size() < 3) {
return GT_score{};
}
// need to sort the vertices CW or CCW
cv::convexHull(intersections_unsorted, intersections);