react-native-vision-camera icon indicating copy to clipboard operation
react-native-vision-camera copied to clipboard

Using a photo set to test frame processor plugins❓

Open Easy47 opened this issue 2 years ago • 4 comments

Question

How to test the accuracy of frames processor?

What I tried

I would like to be able to measure the accuracy of frame processor plugins QR code reader and OCR.

To do this I would like to be able to give to the two frame processor plugins a photo set and observe the results for each photo of the set and measure the accuracy ? To sum up, I would like to be able to test frame processor plugins alone with a photo set.

Ideas ? Thanks in advance :)

VisionCamera Version

latest

Additional information

Easy47 avatar Jul 07 '22 17:07 Easy47

Well you can just count the successful reads yourself:

const successfulReads = useSharedValue(0)

const frameProcessor = useFrameProcessor((frame) => {
  'worklet'
  
  const textInImage = scanTextInImageOCR(frame)
  if (textInImage.length > 0)
    successfulReads.value += 1
}, [])

mrousavy avatar Jul 08 '22 11:07 mrousavy

Thank you for your answer. However, this is not possible: To be able to measure the impact of image pre-processing (for example), we need to ALWAYS have the same inputs (exactly the same). This is the main problem. We really need a way to be able to control the input flow exactly.

Easy47 avatar Jul 08 '22 14:07 Easy47

Hi, I have similar use case where I'd like to pass an image to frameProcessor. Is it possible to map Image to Frame?

wojteklembryk avatar Jul 27 '22 13:07 wojteklembryk

Did you find something ?

Easy47 avatar Aug 22 '22 18:08 Easy47

@Easy47 @wojteklembryk any updates on this? I am facing the same problem in which I want to be able to test the plugin using a static image.

EmielStoelinga avatar Feb 01 '23 08:02 EmielStoelinga

@Easy47 @wojteklembryk any updates on this? I am facing the same problem in which I want to be able to test the plugin using a static image.

I made a frame processor plugin in which I load an image. I did not succeed in directly returning the frame so I test in the same plugin

Easy47 avatar Feb 01 '23 08:02 Easy47

@Easy47 @wojteklembryk any updates on this? I am facing the same problem in which I want to be able to test the plugin using a static image.

I made a frame processor plugin in which I load an image. I did not succeed in directly returning the frame so I test in the same plugin

I changed approach and instead of reusing frame processor I extracted it's logic into separate component. My case was Google MLKit based so I use image picker that's pass data to MLKit bridge and then apply shared frame processor logic.

wojteklembryk avatar Feb 01 '23 10:02 wojteklembryk

Closing as this is a stale issue - this might have been fixed with the full rewrite in VisionCamera V3 (🥳) - if not, please create a new issue.

mrousavy avatar Sep 30 '23 09:09 mrousavy