Skip to content

Instantly share code, notes, and snippets.

python voc_annotation.py --voc_path gs://[YOUR_BUCKET_NAME]/VOCdevkit --voc_classes_path model_data/voc_classes.txt
path/to/img1.jpg x11,y11,x12,y12,some_class_A x21,y21,x22,y22,some_class_B …
path/to/img2.jpg x11,y11,x12,y12,some_class_B …
…….
from tensorflow.python.lib.io import file_io # for better file I/O
import io
from PIL import Image
def gs_open(path, mode='r'):
return file_io.FileIO(path, mode)
def gs_file_exists(path):
return file_io.file_exists(path)
gsutil -m cp -R [SOURCE_LOCAL_LOCATION] gs://[BUCKET_NAME]
gsutil mb -p [PROJECT_NAME] -c [STORAGE_CLASS] -l [BUCKET_LOCATION] -b on gs://[BUCKET_NAME]/
@dneprDroid
dneprDroid / setup.py
Created August 25, 2019 18:42
setup.py - YOLO v3 Keras
from setuptools import setup, find_packages
setup(name='some_project',
version='1.0',
packages=find_packages(),
include_package_data=True,
description='.......',
author='…',
license='Unlicense',
install_requires=[
func buildGraph(device: MTLDevice) -> MPSNNGraph {
let inputNode = MPSNNImageNode()
let node1 = SomeNode1(input: inputNode, weights: ...)
let node2 = SomeNode2(input: node1.resultImage, weights: ...)
let node3 = SomeNode3(input: node2.resultImage, weights: ...)
.....
return MPSNNGraph(device: device,
resultImage: nodeN.resultImage)
}
@dneprDroid
dneprDroid / dir_mov_to_mp4
Last active August 3, 2019 10:01
dir_mov_to_mp4
#!/bin/bash
function convert_in_dir() {
dir_path=$1
extension=$2
for filename in $dir_path/*.$extension; do
echo $filename
file_date=`date -r $filename "+%Y-%m-%d %H-%M"`
@dneprDroid
dneprDroid / gist:8531601fe86ccb1d7ea789ee14dc9e93
Created July 5, 2019 15:39
Firebase - get android debug SHA keystore fingerprint on Windows.
keytool -list -v -keystore %userprofile%\.android\debug.keystore -alias androiddebugkey -storepass android -keypass android
@dneprDroid
dneprDroid / find_voter.py
Last active October 15, 2019 17:18
Find Voter - check petition
# -*- coding: utf-8 -*-
###################### Параметры #########################
PETITION_ID = 73080
REQ_NAME = u'Овечко'
START_PAGE = 1
END_PAGE = 10**100