Git Product home page Git Product logo

Comments (3)

azuryl avatar azuryl commented on June 21, 2024

you need to change
image load_image_stb_squeezenet(char *filename, int channels)
{
int w, h, c;
unsigned char *data = stbi_load(filename, &w, &h, &c, channels);
if (!data) {
fprintf(stderr, "Cannot load image!!!!!!!!!!!! "%s"\nSTB Reason: %s\n", filename, stbi_failure_reason());
exit(0);
image im;
im.data=0;
return im;
}
if(channels) c = channels;
int i,j,k;
image im = make_image(w, h, c);

 //For Squeezenet
for(k = 0; k < c; ++k){
    for(j = 0; j < h; ++j){
        for(i = 0; i < w; ++i){
                            if (k==0) {
                                    int dst_index = i + w*j + w*h*(k+2);
                                    int src_index = k + c*i + c*w*j;
                                    im.data[dst_index] = ((float)data[src_index]-123);
                            }
                            if (k==1) {
                                    int dst_index = i + w*j + w*h*k;
                                    int src_index = k + c*i + c*w*j;
                                    im.data[dst_index] = ((float)data[src_index]-117);
                            }
                            if (k==2) {
                                    int dst_index = i + w*j + w*h*(k-2);
                                    int src_index = k + c*i + c*w*j;
                                    im.data[dst_index] = ((float)data[src_index]-104);
                            }
        }
    }
}

free(data);
return im;

}

from squeezenet-darknet-model.

92jisuk avatar 92jisuk commented on June 21, 2024

Hi. Thank you for sharing your code.

I downloaded your cfg file and weight file and run following command:
./darknet classifier predict cfg/imagenet1k.data cfg/squeezenet.cfg squeezenet_darknetformat.weight data/dog.jpg

In this command, cfg/squeezenet.cfg and squeezenet_darknetformat.weight is downloaded from your github.
And cfg/imagenet1k.data and data/dog.jpg is basic files of darknet.

I also changed the image.c file following your reply of this issue.

But an accuracy is very low...
Should I perform a training for high accuracy?

Thank you.

from squeezenet-darknet-model.

azuryl avatar azuryl commented on June 21, 2024

no I am not trained, you also should change the code in classifier.c to call the load_image_stb_squeezenet()

from squeezenet-darknet-model.

Related Issues (2)

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.