Skip to content

Instantly share code, notes, and snippets.

@AlexeyGy
AlexeyGy / restore_date.py
Created June 3, 2022 20:54
Fix pixel created date in FCPX when importing media.
import os
import argparse
import re
from datetime import datetime
import subprocess
parser = argparse.ArgumentParser(description='Restore creation dates')
parser.add_argument('dir', help='Directory to parse for PXL files.')
args = parser.parse_args()
diff --git a/woo-min-max-quantity.php b/woo-min-max-quantity.php
index f9614ef..c35e2b9 100644
--- a/woo-min-max-quantity.php
+++ b/woo-min-max-quantity.php
@@ -86,7 +86,7 @@ function _wcmmax_options_page()
<table>
<tr valign="top">
- <th scope="row"><label for="_wcmmax_options_option_name">Custom alert message for maximum Quantity limit </label></th>
+ <th scope="row"><label for="_wcmmax_options_option_name">Custom alert message for maximum Quantity limit. Use $maximum to have the maximum in the text.</label></th>
function take_snapshot() {
Webcam.snap(function (data_uri) {
// snap complete, image data is in 'data_uri' see https://github.com/jhuckaby/webcamjs/blob/master/DOCS.md
Webcam.upload(
data_uri,
"https://raspberrypi:5000/upload",
function (response_code, response_data) {
if (response_code === 200) {
var parsed_response_data = JSON.parse(response_data);
clearCanvas();
@AlexeyGy
AlexeyGy / app.py
Last active December 6, 2020 10:44
API backend
import datetime
import os
from logging import info
from typing import List
import cv2 as cv
import numpy as np
from flask import (
Flask,
jsonify,
# this script performs a testwise detection of the content of test-images
import unittest
import cv2 as cv
from model import recognize, set_up_inference
NET = None
class TestDetection(unittest.TestCase):
import os
from logging import info
from typing import List
import numpy as np
import cv2 as cv
INPUT_FOLDER = "model/" # where we read the neural network from
# the image size that the neural network is trained to work on.
@AlexeyGy
AlexeyGy / set_up.py
Last active November 29, 2020 23:02
import os
from logging import info
from typing import List
import numpy as np
import cv2 as cv
INPUT_FOLDER = "model/" # where we read the neural network from
# a pretrained model from OpenVino, see https://docs.openvinotoolkit.org/2018_R5/_docs_Retail_object_detection_pedestrian_rmnet_ssd_0013_caffe_desc_person_detection_retail_0013.html
import os
from logging import info
from typing import List
import numpy as np
import cv2 as cv
INPUT_FOLDER = "model/" # where we read the neural network from
# the image size that the neural network is trained to work on.
import unittest
import cv2 as cv
from model import recognize, set_up_inference
class TestDetection(unittest.TestCase):
def setUp(self):
self.net = set_up_inference()
@AlexeyGy
AlexeyGy / index-reduced.html
Last active December 6, 2020 11:55
smaller version of index-html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>webcam</title>
</head>
<body>
<script src="webcam.js"></script>
<div>