Giter Club home page Giter Club logo

Comments (21)

Kagami avatar Kagami commented on June 12, 2024 2

Not yet, I will check a bit later.

from go-face.

vaizmanai avatar vaizmanai commented on June 12, 2024 1

@SXerox007 i will check today at home and ping you

from go-face.

Kagami avatar Kagami commented on June 12, 2024

Try with higher tolerance.

from go-face.

SXerox007 avatar SXerox007 commented on June 12, 2024

I increased the tolerance small 0.8 then it always give the can't classify.

from go-face.

SXerox007 avatar SXerox007 commented on June 12, 2024

But both the images are same

from go-face.

Kagami avatar Kagami commented on June 12, 2024

Please upload your test code and images.

from go-face.

SXerox007 avatar SXerox007 commented on June 12, 2024

`
//TODO ---> Get the image url from db

dataImage := filepath.Join(DATA_DIR, "mix.jpg")

faces, err := rec.RecognizeFile(dataImage)
if err != nil {
	return err
}

var samples []face.Descriptor
var totalF []int32
for i, f := range faces {
	samples = append(samples, f.Descriptor)
	// Each face is unique on that image so goes to its own category.
	totalF = append(totalF, int32(i))
}

// Pass samples to the recognizer.
rec.SetSamples(samples, totalF)

// Now let's try to classify some not yet known image.

testData := filepath.Join(DATA_DIR, "sumit.jpg")
res, err := [rec.RecognizeSingleFile(testData)](url)
if err != nil {
	log.Println("Face not recorganise not the same person")
	return status.Errorf(
		codes.Internal,
		fmt.Sprintln(errormsg.ERR_FACE_NOT_REC))
}
if res == nil {
	log.Println("Not a sigle image")
	return status.Errorf(
		codes.Internal,
		fmt.Sprintln(errormsg.ERR_NOT_A_SINGLE_FACE))
}
id := rec.ClassifyThreshold(res.Descriptor, 0.6)
if id < 0 {
	log.Println("Can't classify")
	return status.Errorf(
		codes.Internal,
		fmt.Sprintln(errormsg.ERR_MSG_INTERNAL_SERVER))
}
log.Println("id", id)
log.Println("Image recorganise")

from go-face.

SXerox007 avatar SXerox007 commented on June 12, 2024

eminem
mix
sumit

from go-face.

SXerox007 avatar SXerox007 commented on June 12, 2024

The three images I uploaded the first one named eminem.jpg 2nd one mix.jpg and 3rd one is sumit.jpg

from go-face.

SXerox007 avatar SXerox007 commented on June 12, 2024

Do you check @Kagami ?

from go-face.

SXerox007 avatar SXerox007 commented on June 12, 2024

Hi @Kagami do you tell me when you will see this issue. ? Can you tell me what's the issue or something any hint !

from go-face.

SXerox007 avatar SXerox007 commented on June 12, 2024

Hi @Kagami have you seen this issue ?

from go-face.

Kagami avatar Kagami commented on June 12, 2024

Hi, not yet, currently busy with other projects.

from go-face.

vaizmanai avatar vaizmanai commented on June 12, 2024

@SXerox007 hey, guy! I was writing some functions for using with go-face and it works properly:

func compare_faces(samples []face.Descriptor, comp face.Descriptor, tolerance float32) int {
	res := face_distance(samples, comp)
	r := -1
	v := float32(1)

	for i, s := range res {
		t := euclidean_norm(s)
		if t < tolerance && t < v{
			v = t
			r = i
		}
	}

	return r
}

func face_distance(samples []face.Descriptor, comp face.Descriptor) []face.Descriptor {
	res := make([]face.Descriptor, len(samples))

	for i, s := range samples {
		for j, _ := range s {
			res[i][j] = samples[i][j] - comp[j]
		}
	}

	return res
}

func euclidean_norm(f face.Descriptor) float32 {
	var s float32
	for _, v := range f {
		s = s + v * v
	}

	return float32(math.Sqrt(float64(s)))
}

You can call compare_faces and it will return index of samples with the best matches but below set tolerance.

from go-face.

SXerox007 avatar SXerox007 commented on June 12, 2024

@vaizmanai not working.

from go-face.

SXerox007 avatar SXerox007 commented on June 12, 2024

Test with multiple images ,single image result is same. Not working.

from go-face.

vaizmanai avatar vaizmanai commented on June 12, 2024

@SXerox007 so it is working properly, i used your part of code, your test images, check youself: test

from go-face.

SXerox007 avatar SXerox007 commented on June 12, 2024

@vaizmanai I use the different images. id return some value if image is not even the same. I click the image form my phone and compare it will be return some value.

from go-face.

vaizmanai avatar vaizmanai commented on June 12, 2024

Attach example photos with fails

from go-face.

SXerox007 avatar SXerox007 commented on June 12, 2024

@vaizmanai busy with some other things send you the example soon.

from go-face.

Kagami avatar Kagami commented on June 12, 2024

I've fixed few bugs in ClassifyThreshold, please try with latest version from master.

from go-face.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.