Skip to content

Instantly share code, notes, and snippets.

View avalchev94's full-sized avatar

Asen Valchev avalchev94

View GitHub Profile
for face_idx, face in enumerate(profile.face_cluster.faces):
logger.debug(f'Looking at at face {face_idx} of profile {profile.id}')
centroid_distances = np.linalg.norm(centroids - np.array(face.embedding), axis=1)
logger.debug(f'Distances of profile {profile.id} to centroids: {centroid_distances}')
face_match = org_database.index[centroid_distances < self.threshold]
face_matches.update(face_match)
logger.debug(f'Face matches found: {face_match}')
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/asenvalchev/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
@avalchev94
avalchev94 / concurrency.go
Created May 26, 2020 16:11
How would you fix me?
client := &Client{
username: ....,
send: make(chan *profiles.Profile, 100),
}
clients[clientId] = client
// .......
for _, client := range clients {
select {
var dragged = null
canvas.onmousedown = e => {
if (scene.overlap(e.x, e.y)) {
dragged = scene.pt
}
}
canvas.onmousemove = e => {
if (dragged != null) {