This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3.5 | |
import os | |
import glob | |
import pathlib | |
from pathlib import Path | |
# How to use: | |
# Run in directory with folders named from 1 and up to 99. Each folder should contain *.JPG files. | |
# Script will downscale all files that are not yet downscaled to "downscaled" subdirectory and stitch to multiple pdfs: pdf per folder + single full pdf. | |
# Example of input directories: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See https://streamhpc.com/blog/2016-02-09/atomic-operations-for-floats-in-opencl-improved/ | |
static float atomic_cmpxchg_f32(volatile __global float *p, float cmp, float val) { | |
union { | |
unsigned int u32; | |
float f32; | |
} cmp_union, val_union, old_union; | |
cmp_union.f32 = cmp; | |
val_union.f32 = val; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configure path to photoscan: | |
PHOTOSCAN_PATH=<.../photoscan-pro> | |
PYTHON_PATH=${PHOTOSCAN_PATH}/python | |
OPENCV_VERSION=3.4.0 | |
INSTALLATION_PATH=/opt/opencv-${OPENCV_VERSION} | |
sudo mkdir -p ${INSTALLATION_PATH} | |
# Install numpy (OpenCV requires it) | |
CPPFLAGS=-I${PYTHON_PATH}/include/python3.5m LDFLAGS=-L${PYTHON_PATH}/lib ${PYTHON_PATH}/bin/python3.5 -m pip install numpy==1.08 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int triangles[256][5*3+1] = {{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},{ 0, 4, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, | |
{ 5, 0, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, | |
{ 8, 9, 5, 8, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, | |
{ 1, 5, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, | |
{ 0, 4, 8, 1, 5, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, | |
{ 9, 11, 1, 9, 1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, | |
{ 8, 9, 11, 8, 11, 1, 8, 1, 4, -1, -1, -1, -1, -1, -1, -1}, | |
{ 4, 1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, | |
{ 10, 8, 0, 10, 0, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, | |
{ 5, 0, 9, 4, 1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
import subprocess | |
from collections import namedtuple | |
def get_memory(key="total"): | |
# See https://doeidoei.wordpress.com/2009/03/22/python-tip-3-checking-available-ram-with-python/ | |
if os.name == "posix": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing.*; | |
import java.awt.*; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import static javax.swing.WindowConstants.EXIT_ON_CLOSE; | |
public class Main { | |
public static void main(String[] args) throws InterruptedException { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
def get_memory(key="total"): | |
key_to_index = { | |
"total": 1, | |
"used": 2, | |
"free": 3, | |
"shared": 4, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.13) | |
project(video_optflow) | |
set(CMAKE_CXX_STANDARD 14) | |
find_package(OpenMP) | |
if (OpenMP_CXX_FOUND) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") | |
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}") | |
else() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Metashape | |
# wget https://www.dropbox.com/s/hh5yg0fmpr4bpn3/benchmarking_1.3.zip | |
# unzip benchmarking_1.3.zip | |
project = "benchmark2.psz" | |
Metashape.app.gpu_mask = (2 ** 16) - 1 | |
Metashape.app.cpu_enable = False | |
Metashape.app.document.open(project, read_only=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/PC/python.manifest | |
+++ b/PC/python.manifest | |
@@ -1,6 +1,6 @@ | |
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | |
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> | |
- <trustInfo> | |
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> | |
<security> | |
<requestedPrivileges> | |
<requestedExecutionLevel level="asInvoker" uiAccess="false"/> |