Skip to content

Instantly share code, notes, and snippets.

View scivision's full-sized avatar
💭
I will be slow to respond.

scivision

💭
I will be slow to respond.
View GitHub Profile
@scivision
scivision / Readme.md
Last active October 8, 2026 19:05
Our optical flow repositories

Optical flow repositories I've collected

I've collected a few optical flow repositories that interested us due to their use in papers relevant to our field. There are many, many more algorithms that are likely of greater merit-here's just a few I've looked at over time.

  • Black Robust Optical Flow uses C code from 1996 originally. I created Python and Matlab interfaces to this. I added CMake and updated the C code to work on modern compilers. There is newer code from Black circa 2010 that is said to be easier to use and more effective.
  • PyOptFlow I implemented Python and Matlab code for Horn Schunck optical flow
  • Python Lucas Kanade I improved Python code for Lucas Kanade optical flow
  • Phantom generator I wrote a Python phantom generator that makes morphing / moving shapes that are roughly like
@scivision
scivision / CMAKE.instructions.md
Last active October 9, 2026 17:54
GitHub copilot instructions examples
name CMake Standards
description Coding conventions for CMake files
applyTo **/*.cmake,**/CMakeLists.txt

Editing rules

  • Assume CMake 3.26 or newer is available cmake_minimum_required(VERSION 3.26)
  • Use cmake_path() instead of get_filename_component()
@scivision
scivision / .gitignore
Last active October 6, 2026 22:31
Use "gh" to check a list of Actions for major updates
*.json
__pycache__/
@scivision
scivision / Readme.md
Last active September 28, 2026 20:20
Minimal CMake install script using older CMake

Minimal CMake install using older CMake

We often find such a platform-independent script handy for CI or for helping end users get a new-enough CMake. It can also be used to install older specific CMake versions for CI testing of minimum CMake versions.

We have a more elaborate and general script that handles older CMake versions at cmakeutils under scripts/install_cmake.cmake. This script here is intentionally very minimal and does little error checking.

@scivision
scivision / readme.md
Last active September 25, 2026 18:08
CMake version in repository by Linux distribution
@scivision
scivision / Readme.md
Last active September 22, 2026 21:52
Heterogeneous CPU counts in Python

Heterogeneous CPU core count

This Python script uses only built-in stdlib functions and attempts to detect the CPU count of each type of CPU core. Many CPUs have only one core type, while others (especially for laptops) may have 2 or more CPU core types, sometimes called "big-little" or "super-performance-efficiency".

Usage

python cpu_hetero.py
cmake_minimum_required(VERSION 3.19)
project(mod_files LANGUAGES Fortran)
enable_testing()
include(CheckCompilerFlag)
set(tgt dummy)
set(submod define_pi)
@scivision
scivision / aocc.sh
Last active September 10, 2026 22:01
AOCC AMD compiler source script
# Activate AOCC compilers by
# source aocc.sh
version=6.0.0
root=/opt/AMD/aocc-compiler-${version}
[[ ! -d ${root} ]] && echo "ERROR: ${root} not found" && exit 1
source ${root}/setenv_AOCC.sh
@scivision
scivision / CMakeLists.txt
Last active September 11, 2026 22:42
Find maximum source file length a Fortran compiler can handle with CMake
cmake_minimum_required(VERSION 3.25)
project(MaxFortran LANGUAGES Fortran)
set(CMAKE_EXECUTE_PROCESS_COMMAND_ECHO STDOUT)
if(NOT DEFINED N)
if(CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC")
# tested with NVHPC SDK 26.5
set(N 1000)
@scivision
scivision / CMakeLists.txt
Created August 31, 2026 19:14
Test CMAKE_COMPILE_WARNING_AS_ERROR with Fortran
cmake_minimum_required(VERSION 4.4)
project(FlangErr LANGUAGES Fortran)
if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU|LLVMFlang")
add_compile_options(-Wunused-variable)
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
add_compile_options(-warn:unused)
endif()