Skip to content

Instantly share code, notes, and snippets.

View chichivica's full-sized avatar

Ivan Talalaev chichivica

View GitHub Profile
def _load_simple_annotation(self, index):
"""
Load image and bounding boxes info from txt space separeted values where you have
lines in the format of
classification x1 y1 x2 y2
"""
filename = os.path.join(self._data_path, 'Annotations', index + '.txt')
# print 'Loading: {}'.format(filename)
with open(filename) as f:
@regeda
regeda / underscore.go
Last active December 12, 2018 10:23
Convert CamelCase to underscore in golang with UTF-8 support.
package main
import (
"testing"
"unicode"
"unicode/utf8"
"github.com/stretchr/testify/assert"
)
@salihkaragoz
salihkaragoz / coco_getcat.py
Last active May 23, 2019 12:52
COCO categories
import json
data = json.load(open('instances_train2017.json'))
print data.keys()
#OUTPUT :
# [u'info', u'licenses', u'images', u'annotations', u'categories']
print data['categories']
'''
@DrSleep
DrSleep / README
Last active August 16, 2020 17:04
KITTI VISUAL ODOMETRY DATASET
## http://cvlibs.net/datasets/kitti/eval_semantics.php
## https://omnomnom.vision.rwth-aachen.de/data/rwth_kitti_semantics_dataset.zip
### DATASET FOR SEMANTIC SEGMENTATION
@royshil
royshil / opencv_capture_v4l2.py
Created March 4, 2016 18:59
A way to set V4L2 camera params for OpenCV, when cv2.VideoCapture doesn't work. This requires the python-v42lcapture module (https://github.com/gebart/python-v4l2capture)
#!/usr/bin/env python
import numpy as np
import cv2
import os
import v4l2capture
import select
if __name__ == '__main__':
#cap = cv2.VideoCapture(0)
@gmacario
gmacario / Dockerfile
Last active November 23, 2021 02:40
Can you run GUI apps in Docker?
# From http://stackoverflow.com/questions/16296753/can-you-run-gui-apps-in-a-docker
#
# Firefox over VNC
#
# VERSION 0.1
# DOCKER-VERSION 0.2
from ubuntu:12.04
# make sure the package repository is up to date
run echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
@aspyct
aspyct / common.h
Created July 15, 2012 22:00
Unix semaphore with the C programming language, tested under Debian
#ifndef _COMMON_H_
#define _COMMON_H_
#define SEM_KEY_FILE ("sem.key")
#endif /* _COMMON_H_ */
@vokiel
vokiel / console.sh
Last active August 18, 2022 18:54
PHPStorm xdebug POST to REST with httpie from the cli
echo '{"id":8}' | http --verify=no POST https://service.dev/api/id Content-Type:application/json 'Cookie:XDEBUG_SESSION=PHPSTORM'
@underdoeg
underdoeg / hx711.py
Last active August 26, 2023 23:33
Python port for RaspberryPI of the HX711 Breakout Board
import RPi.GPIO as GPIO
import time
def createBoolList(size=8):
ret = []
for i in range(8):
ret.append(False)
return ret
@niccokunzmann
niccokunzmann / hanging_threads.py
Last active September 27, 2023 08:13
This module prints all hanging threads that are dead locked. It is for Python 2 and 3. Installable: https://pypi.python.org/pypi/hanging_threads
## The MIT License (MIT)
## ---------------------
##
## Copyright (C) 2014 Nicco Kunzmann
##
## https://gist.github.com/niccokunzmann/6038331
##
## Permission is hereby granted, free of charge, to any person obtaining
## a copy of this software and associated documentation files (the "Software"),