Skip to content

Instantly share code, notes, and snippets.

View fernandoseguim's full-sized avatar
🎯
Focusing

Fernando Seguim fernandoseguim

🎯
Focusing
View GitHub Profile

Keybase proof

I hereby claim:

  • I am fernandoseguim on github.
  • I am seguim (https://keybase.io/seguim) on keybase.
  • I have a public key ASD6YzClVoG7Vs3wYF1TMQBNkpKNHTxhgltfCgpbOXpgKAo

To claim this, I am signing this object:

@fernandoseguim
fernandoseguim / cloudSettings
Last active August 12, 2021 01:39
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-04-30T01:05:40.369Z","extensionVersion":"v3.4.3"}
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
variables:
BuildConfiguration: Release
FORCE_PUSH_NUGET: ${{ eq(variables['Build.SourceBranch'], 'refs/heads/develop') }}
trigger:
@fernandoseguim
fernandoseguim / git-update-fork.sh
Created August 13, 2019 03:33 — forked from rdeavila/git-update-fork.sh
Git: como atualizar um fork com as mudanças do original?
#!/bin/bash
# Adicione um novo remote; pode chamá-lo de "upstream":
git remote add upstream https://github.com/usuario/projeto.git
# Obtenha todos os branches deste novo remote,
# como o upstream/master por exemplo:
git fetch upstream
public static object GetValue(AttributeValue value) => GetString(value);
private static object GetString(AttributeValue value) => !string.IsNullOrEmpty(value.S) ? value.S : GetNumber(value);
private static object GetNumber(AttributeValue value) => !string.IsNullOrEmpty(value.N) ? value.N : GetObject(value);
private static object GetObject(AttributeValue value)
{
if (value?.M?.Count > 0)
{
# Suppress: EC112 EC114
root = true
[*]
charset = utf-8
max_line_length = 120
end_of_line = crlf
indent_size = 4
indent_style = space
insert_final_newline = false
foreach(var faceDetail in response.FaceDetails)
{
foreach(var emotion in faceDetail.Emotions)
{
if(emotion.Confidence > confidence) { Console.WriteLine($"this person may feel {emotion.Type}"); }
}
}
const float CONFIDENCE_LEVEL = 90;
var count = 0;
using(var source = new MemoryStream(image))
{
var request = new DetectFacesRequest { Image = new Image() { Bytes = source }, Attributes = new List<string> { "ALL" } };
var response = await amazonRekognitionClient.DetectFacesAsync(request);
foreach(var faceDetail in response.FaceDetails)
var image1 = await File.ReadAllBytesAsync("path\\to\\source\\image");
var image2 = await File.ReadAllBytesAsync("path\\to\\target\\image");
const float SIMILARITY_THRESHOLD = 75;
const float CONFIDENCE_LEVEL = 95;
using(var source = new MemoryStream(image1))
using(var target = new MemoryStream(image2))
{
var request = new CompareFacesRequest
private static bool HaveSamePerson(IEnumerable<CompareFacesMatch> facesMatches, float similarity, float confidence)
=> facesMatches.Any(label => label.Similarity > similarity && label.Face.Confidence > confidence);