Skip to content

Instantly share code, notes, and snippets.

@yoelk
yoelk / tcam_demo.cpp
Created August 14, 2018 09:05
C++ code to follow up inter-frame delays
#include <gst/gst.h>
#include <iostream>
#include <memory>
#include <ctime>
#include <chrono>
#include "unistd.h"
@yoelk
yoelk / print log
Last active August 10, 2018 10:37
Test code for showing that it's not possible to keep 30 FPS over time
tcambin serial="20810358" name=source ! video/x-raw,format=GRAY8,width=1920,height=1080,framerate=30/1 ! videoconvert ! appsink name=sink
Press Esc to stop
No image reveived
--- FPS = 14.021855258540066
--- FPS = 14.048198373782677
--- FPS = 14.053658882220258
--- FPS = 14.06174532870176
--- FPS = 14.06463707090887
--- FPS = 14.064004083831776
--- FPS = 14.063271080079687
@yoelk
yoelk / program.py
Created August 8, 2018 11:34
test program to show the inability to set `Focus Auto` to True
import cv2
import numpy
import gi
from collections import namedtuple
gi.require_version("Gst", "1.0")
gi.require_version("Tcam", "0.1")
from gi.repository import Tcam, Gst, GLib, GObject
@yoelk
yoelk / opencv-multiprocessing-issue
Created June 25, 2018 23:19
Small sample code that uses OpenCV to show images from a camera. If an mp.Manager is created, the code stops working. Commenting the line fixes it but why???
import cv2
import multiprocessing as mp
cap = cv2.VideoCapture(0)
manager = mp.Manager() # Comment this line to make the code work
with mp.Lock():
cap.set(6, cv2.VideoWriter_fourcc(*list('MJPG')))
@yoelk
yoelk / gist:9d57fac416fea8017e0c233dffaf67a5
Created June 20, 2018 19:34
modified tis-camera python example
import numpy
import gi
from collections import namedtuple
import cv2
gi.require_version("Gst", "1.0")
gi.require_version("Tcam", "0.1")
from gi.repository import Tcam, Gst, GLib, GObject
@yoelk
yoelk / stdout
Created April 3, 2018 22:02
kivy make test
(kivy) ➜ kivy git:(master) ✗ make test
rm -rf kivy/tests/build
python -m nose.core kivy/tests
/usr/lib/python3.6/runpy.py:125: RuntimeWarning: 'nose.core' found in sys.modules after import of package 'nose', but prior to execution of 'nose.core'; this may result in unpredictable behaviour
warn(RuntimeWarning(msg))
[WARNING] [Config ] Older configuration version detected (19 instead of 20)
[WARNING] [Config ] Upgrading configuration in progress.
[INFO ] [Logger ] Record log in /home/joel/.kivy/logs/kivy_18-04-03_0.txt
[INFO ] [Factory ] 194 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
@yoelk
yoelk / kivy_18-01-11_8.txt
Created January 11, 2018 10:56
Not able to use Kivy for Python3.6.3 in Ubuntun 16.04, 64-bit
[INFO ] Logger: Record log in /home/yonatan/.kivy/logs/kivy_18-01-11_8.txt
[INFO ] Kivy: v1.10.0
[INFO ] Python: v3.6.3 (default, Oct 6 2017, 08:44:35)
[GCC 5.4.0 20160609]
[INFO ] Factory: 194 symbols loaded
[DEBUG ] Cache: register <kv.lang> with limit=None, timeout=None
[DEBUG ] Cache: register <kv.image> with limit=None, timeout=60
[DEBUG ] Cache: register <kv.atlas> with limit=None, timeout=None
[INFO ] Image: Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[DEBUG ] Cache: register <kv.texture> with limit=1000, timeout=60
@yoelk
yoelk / log file
Created January 11, 2018 10:08
Unable to find any valuable Window provider.
[INFO ] Logger: Record log in /home/yonatan/.kivy/logs/kivy_18-01-11_5.txt
[INFO ] Kivy: v1.10.0
[INFO ] Python: v3.6.3 (default, Oct 6 2017, 08:44:35)
[GCC 5.4.0 20160609]
[INFO ] Factory: 194 symbols loaded
[DEBUG ] Cache: register <kv.lang> with limit=None, timeout=None
[DEBUG ] Cache: register <kv.image> with limit=None, timeout=60
[DEBUG ] Cache: register <kv.atlas> with limit=None, timeout=None
[INFO ] Image: Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[DEBUG ] Cache: register <kv.texture> with limit=1000, timeout=60
@yoelk
yoelk / cli.py
Created November 16, 2017 11:09
Error while using sk-learn in cythonized code
from __future__ import print_function
import numpy as np
from sklearn.base import TransformerMixin
from sklearn.pipeline import Pipeline, FeatureUnion
from sklearn.model_selection import GridSearchCV
from sklearn.svm import SVC
from sklearn.datasets import load_iris
from sklearn.decomposition import PCA