Open Le0v1n opened 2 years ago
I modify COUNT_OF_FRAMES_PER_INFERENCE=4 -> 16 in Constants.javaand it has error when program running:
COUNT_OF_FRAMES_PER_INFERENCE=4 -> 16
Constants.java
E/AndroidRuntime: FATAL EXCEPTION: ModuleActivity Process: org.pytorch.demo.torchvideo, PID: 6094 java.lang.IllegalStateException: Buffer underflow
Specific in LiveVideoClassificationActivity.java:
LiveVideoClassificationActivity.java
TensorImageUtils.bitmapToFloatBuffer(centerCroppedBitmap, 0, 0, Constants.TARGET_VIDEO_SIZE, Constants.TARGET_VIDEO_SIZE, Constants.MEAN_RGB, Constants.STD_RGB, inTensorBuffer, (Constants.COUNT_OF_FRAMES_PER_INFERENCE - 1) * mFrameCount * Constants.TARGET_VIDEO_SIZE * Constants.TARGET_VIDEO_SIZE);
mFrameCount in [0, 4] is normal, but it will have error when mFrameCount > 4.
mFrameCount > 4
MainActivity.javahas the same problem of Buffer underflow when COUNT_OF_FRAMES_PER_INFERENCE = 4 -> COUNT_OF_FRAMES_PER_INFERENCE > 4.
MainActivity.java
Buffer underflow
COUNT_OF_FRAMES_PER_INFERENCE = 4
COUNT_OF_FRAMES_PER_INFERENCE > 4
So How to solve this problem of Buffer underflow?
Thank you very much!
I modify
COUNT_OF_FRAMES_PER_INFERENCE=4 -> 16
inConstants.java
and it has error when program running:Specific in
LiveVideoClassificationActivity.java
:mFrameCount in [0, 4] is normal, but it will have error when
mFrameCount > 4
.MainActivity.java
has the same problem ofBuffer underflow
whenCOUNT_OF_FRAMES_PER_INFERENCE = 4
->COUNT_OF_FRAMES_PER_INFERENCE > 4
.So How to solve this problem of
Buffer underflow
?Thank you very much!