Skip to content

Instantly share code, notes, and snippets.

@igor-panteleev
igor-panteleev / build.py
Created December 7, 2017 10:59
devicehive-video-analysis DarkFlow modifications
# darkflow/net/build.py
def saveckpt(self):
self.saver.save(self.sess, './{}_model.ckpt'.format(self.meta['name']))
@igor-panteleev
igor-panteleev / mastermind.py
Last active May 17, 2018 13:51
Python implementation of Knuths' "Five-guess algorithm"
import argparse
import itertools
import random
def score(self, other, options):
first = len([a for a, b in zip(self, other) if a == b])
second = sum(min(self.count(i), other.count(i)) for i in options) - first
return first, second