GithubHelp home page GithubHelp logo

量化以后,最后计算得到的位置xywh为定点数,怎么确定在图片中的位置,需要反量化吗 about ncnn-yolov4-int8 HOT 6 CLOSED

ppogg avatar ppogg commented on May 29, 2024
量化以后,最后计算得到的位置xywh为定点数,怎么确定在图片中的位置,需要反量化吗

from ncnn-yolov4-int8.

Comments (6)

ppogg avatar ppogg commented on May 29, 2024

没太看明白你的意思,你是说在量化模型后对图片预测,如何得到检测目标在图片中xywh四点位置信息是吗?

from ncnn-yolov4-int8.

zhvn100 avatar zhvn100 commented on May 29, 2024

嗯嗯,因为这个定点数他是一个函数映射出来进行计算的值吧,在实际的检测图片上没办法去得到xywh的位置信息,因为我想做硬件加速器去实现,所以最后得到的定点数位置信息,怎么转换成实际图片上的位置信息呢

from ncnn-yolov4-int8.

ppogg avatar ppogg commented on May 29, 2024

不太确定这个是不是你想要得到的答案:
在yolov4.cpp的line154~line159:

const Object& obj = objects[i];
        fprintf(stderr, "%d = %.5f at %.2f %.2f %.2f x %.2f\n", obj.label, obj.prob,
            obj.rect.x, obj.rect.y, obj.rect.width, obj.rect.height);
        cv::rectangle(image, obj.rect, cv::Scalar(255, 0, 0));

nihui大佬将xywh四点位置信息封装到obj中,假设我的检测推理时是将图片resize成160px160px,那么你是需要计算出他换算的比例尺,比如,你的原始图片为640px640px,缩放比例ratio=4,当你通过这个推理脚本得到resize图片的xywh位置信息,你需要以图片中心为基准点,根据这个比例尺换算出实际图片的xywh信息。

from ncnn-yolov4-int8.

zhvn100 avatar zhvn100 commented on May 29, 2024

好像不太一样,nihui大佬是有一套完整的yolov4量化代码吗,能发一下地址吗,麻烦了

from ncnn-yolov4-int8.

ppogg avatar ppogg commented on May 29, 2024

嗯嗯,nihui六月份还有更新ncnn的框架,你可以直接编译进行量化的
ncnn链接:https://github.com/Tencent/ncnn
ncnn的一些注意事项:https://github.com/Tencent/ncnn/wiki/quantized-int8-inference
祝好运兄弟

from ncnn-yolov4-int8.

zhvn100 avatar zhvn100 commented on May 29, 2024

好的,谢谢

from ncnn-yolov4-int8.

Related Issues (4)

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.