Skip to content

Instantly share code, notes, and snippets.

View TeddybearCrisis's full-sized avatar

TeddybearCrisis TeddybearCrisis

View GitHub Profile
@TeddybearCrisis
TeddybearCrisis / enable_cmake_vs2015.bat
Created February 10, 2019 12:48
Enable cmake for Visual Studio 2015
@echo off
:: when cmake-gui shows the error 'CXX compiler identification unknown' when trying to use the VS 2015 generator
:: this script can help. It goes back to the following solution:
:: https://stackoverflow.com/questions/14372706/visual-studio-cant-build-due-to-rc-exe/46166632#46166632
:: The reason is that cmake-gui always ends up using the Win 10 SDK where tools are missing for VS2015
:: This script opens a console and prompts it to use the 8.1 SDK
cd "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\"
%comspec% /k "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 8.1
start cmake-gui
@TeddybearCrisis
TeddybearCrisis / CvContourNode.py
Created August 11, 2019 17:14
OpenCV Contour Tree Iteration Class
# import for instances returned from class methods
from __future__ import annotations
import sys
from typing import Optional, List, Any
import cv2
from cars.colab.model.Global import CvRect
from cars.colab.util import Units
@TeddybearCrisis
TeddybearCrisis / PyCharmLogPatternRegex.cfg
Last active November 6, 2019 11:26
PyCharm Log Regex Pattern
[Name]
Python Logs
[Message pattern]
^(\d{4}-\d{2}-\d{2}\s[\S]+)\s\[?(\w+)\]?\s(.*)
[Message start pattern]
^\d{4}-\d{2}-\d{2}\s[\S]+
[Time format]
@TeddybearCrisis
TeddybearCrisis / Install_OpenCV4_CUDA10.2.md
Last active May 2, 2020 22:53 — forked from raulqf/Install_OpenCV4_CUDA12.6_CUDNN8.9.md
How to install OpenCV 4.2 with CUDA 10.0 in Ubuntu 18.04

How to install OpenCV 4.2.0 with CUDA 10.2 in Ubuntu distro 18.04

First of all install update and upgrade your system:

    $ sudo apt update
    $ sudo apt upgrade

Then, install required libraries:

@TeddybearCrisis
TeddybearCrisis / cuda_10.2_symlinks.sh
Last active April 21, 2020 21:03
Symlinks for CUDA 10.2
@TeddybearCrisis
TeddybearCrisis / UpdateToOpenCV4.sh
Created May 3, 2020 01:07
Update old OpenCV syntax to OpenCV 4
!#/bin/bash
# original: https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/912#issue-377202823
find src utils \( -name '*.cpp' -or -name '*.hpp' -or -name '*.h' \) \
-exec sed -i \
-e 's/CV_IMWRITE_/cv::IMWRITE_/g' \
-e 's/CV_LOAD_IMAGE_ANYDEPTH/cv::IMREAD_ANYDEPTH/g' \
-e 's/CV_LOAD_IMAGE_COLOR/cv::IMREAD_COLOR/g' \
-e 's/CV_L2/cv::NORM_L2/g' \