Coder Social home page Coder Social logo

Face flag doesnt seem to work about caire HOT 9 CLOSED

kartikwar avatar kartikwar commented on August 19, 2024
Face flag doesnt seem to work

from caire.

Comments (9)

esimov avatar esimov commented on August 19, 2024

The reason is the following: when you are running the CLI with face detection enabled it embeds the facefinder cascade file on-the-fly without to require the cascade file as a standalone flag argument. You can check this one below in the process.go file :

//go:embed data/facefinder

Now, because you are downloading and running the binary file at the same time the data folder is missing and obviously also the facefinder cascade file. The strange thing is that it should have thrown an error that the cascade file is missing or cannot be unpacked like in the line 420:

caire/process.go

Lines 418 to 421 in 1cd0863

p.PigoFaceDetector, err = p.PigoFaceDetector.Unpack(cascadeFile)
if err != nil {
return fmt.Errorf("error unpacking the cascade file: %v", err)
}

I will look into it.

from caire.

kartikwar avatar kartikwar commented on August 19, 2024

Thanks for your reply @esimov. I don't have any experience with go prior to this. Can you please tell me how can this be fixed? Awaiting your reply. Thanks in advance

from caire.

esimov avatar esimov commented on August 19, 2024

If you need a quick resolution, then the most straightforward way is to download the project and run the application inside the root directory where it has been installed. I'm telling this, because I have just realized that in situations like this, when you are running the application once it has been downloaded the embedding might not work just out of the box.

I will try modify the code in such a way that in case the embedded file is not accessible to ask for the cascade file.

from caire.

kartikwar avatar kartikwar commented on August 19, 2024

Whats the command to run it locally? Currently I am using go run github.com/esimov/caire/cmd/caire@latest

from caire.

esimov avatar esimov commented on August 19, 2024

It's stated on the Readme file: go install github.com/esimov/caire/cmd/caire@latest

from caire.

kartikwar avatar kartikwar commented on August 19, 2024

OK but this would run from source right. I want to run locally from root folder like you mentioned. I am guessing the command you shared would fetch from github and run

from caire.

esimov avatar esimov commented on August 19, 2024

I am guessing the command you shared would fetch from github.

Exactly, it will fetch from the Github and also will create the executable. See the documentation: https://go.dev/ref/mod#go-install

Meantime I just wanted to make sure that building locally will embed the cascade file correctly, and it does. So if you build the main go file from cmd/caire running the go build main.go command the face detection will work. I need to figure out why the embedding is not working when you are running directly with go run command.

from caire.

kartikwar avatar kartikwar commented on August 19, 2024

This is working locally by using the go run command as you mentioned. Closing this issue, as this works for me. Also, you might want to update the instructions to run it from local only.

from caire.

esimov avatar esimov commented on August 19, 2024

$ go install github.com/esimov/caire/cmd/caire@latest should install the package along with its dependencies into the $GOPATH/bin folder, exactly as it's described in the README file: https://github.com/esimov/caire#install

from caire.

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.