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

Bounding Box Output allways Same as ResolutionPreset Camera package #50

Open
NasFahmi opened this issue Aug 30, 2024 · 0 comments
Open

Comments

@NasFahmi
Copy link

i have a problem with live detection, see i use camera package to capture image frame by frame and send those frame to yolo model,
i use camera ResolutionPreset.medium which is is 640x840,

void init() async {
vision = FlutterVision();
cameras = await availableCameras(); // Initialize available cameras
controller = CameraController(cameras[0], ResolutionPreset.medium); //! resolution medium is 640x480

// Initialize camera controller
await controller.initialize();

// Get the preview size after the controller is initialized
setState(() {
  isLoaded = true;
  isDetecting = false;
  yoloResults = [];
  cameraPreviewSize = controller.value.previewSize!;
});

await loadYoloModel();

}

when i detect something like chair, and dining table output allways same as ResolutionPreset,
and when i change to high which is 1280x720, output bounding boxes still same with ResolutionPreset,

double left = result["box"][0];
double top = result["box"][1];
double right = result["box"][2];
double bottom = result["box"][3];
final String label = result['tag'];
final String confidence = (result['box'][4] * 100).toStringAsFixed(1);
double objectX = left * factorX;
double objectY = top * factorY;
double objectWidth = (right - left) * factorX;
double objectHeight = (bottom - top) * factorY;`

image

thanks a lot

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