Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quantized YOLOX cannot be use #1480

Open
nockn opened this issue Oct 9, 2024 · 0 comments
Open

Quantized YOLOX cannot be use #1480

nockn opened this issue Oct 9, 2024 · 0 comments

Comments

@nockn
Copy link

nockn commented Oct 9, 2024

Hi.

I downloaded a YOLOX from the Model Zoo.(for PyTorch, Vitis AI 3.0)
I trained it on a custom dataset, and performed quantization and compilation.

However, running it on the board causes PetaLinux to crash after a few predictions.

Do you know what caused this?

Thank you.

#include <stdio.h>

#include <cstdio>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <opencv2/opencv.hpp>
#include <sstream>
#include <string>
#include <typeinfo>
#include <vitis/ai/yolovx.hpp>

using namespace std;
using namespace cv;

#define YOLO_MODEL "YOLOX_nano_pt"
#define CAMERA_ID    1


int main()
{
	// init YOLO
	std::unique_ptr<vitis::ai::YOLOvX, std::default_delete<vitis::ai::YOLOvX>>
		yolo = vitis::ai::YOLOvX::create(YOLO_MODEL, true);

	cv::VideoCapture cap(CAMERA_ID, cv::CAP_V4L2);

	while (1) {
		cv::Mat frame;
		cap >> frame;

		vitis::ai::YOLOvXResult results = yolo->run(frame);
		
		for (auto& result : results.bboxes) {
		 	int label = result.label;
		 	auto& box = result.box;

		 	cout << "RESULT: " << label << "\t" << std::fixed
		 		 << std::setprecision(2) << box[0] << "\t" << box[1] << "\t"
		 		 << box[2] << "\t" << box[3] << "\t" << std::setprecision(6)
		 		 << result.score << "\n";
		}
	}

	return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant