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

[FaceLandmarkDetection] InvalidOperationException: Collection was modified; enumeration operation may not execute. #1253

Open
emoto-yasushi opened this issue Aug 20, 2024 · 2 comments
Assignees
Labels
type:bug Something isn't working

Comments

@emoto-yasushi
Copy link

Plugin Version or Commit ID

v1.4.4

Unity Version

2022.3.6f1

Your Host OS

Windows11 Home

Target Platform

UnityEditor, Windows Standalone

Target Device

No response

[Windows Only] Visual Studio C++ and Windows SDK Version

Visual Studio 2022

[Linux Only] GCC/G++ and GLIBC Version

No response

[Android Only] Android Build Tools and NDK Version

No response

[iOS Only] XCode Version

No response

Build Command

Play the Unity game

Bug Description

During gameplay, an error message like the one below appears. However, the game itself does not stop running

InvalidOperationException: Collection was modified; enumeration operation may not execute.
System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () (at <eef08f56e2e042f1b3027eca477293d9>:0)
System.Collections.Generic.List`1+Enumerator[T].MoveNext () (at <eef08f56e2e042f1b3027eca477293d9>:0)
Mediapipe.Unity.FaceLandmarkListWithIrisAnnotation.PartitionLandmarkList[T] (System.Collections.Generic.IReadOnlyList`1[T] landmarks) (at ./Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkListWithIrisAnnotation.cs:176)
Mediapipe.Unity.FaceLandmarkListWithIrisAnnotation.Draw (System.Collections.Generic.IReadOnlyList`1[T] target, System.Boolean visualizeZ, System.Int32 circleVertices) (at ./Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkListWithIrisAnnotation.cs:116)
Mediapipe.Unity.FaceLandmarkListWithIrisAnnotation.Draw (Mediapipe.Tasks.Components.Containers.NormalizedLandmarks target, System.Boolean visualizeZ, System.Int32 circleVertices) (at ./Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkListWithIrisAnnotation.cs:127)
Mediapipe.Unity.MultiFaceLandmarkListAnnotation+<>c__DisplayClass18_0.<Draw>b__0 (Mediapipe.Unity.FaceLandmarkListWithIrisAnnotation annotation, Mediapipe.Tasks.Components.Containers.NormalizedLandmarks target) (at ./Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiFaceLandmarkListAnnotation.cs:111)
Mediapipe.Unity.ListAnnotation`1[T].CallActionForAll[TArg] (System.Collections.Generic.IReadOnlyList`1[T] argumentList, System.Action`2[T1,T2] action) (at ./Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/ListAnnotation.cs:118)
Mediapipe.Unity.MultiFaceLandmarkListAnnotation.Draw (System.Collections.Generic.IReadOnlyList`1[T] targets, System.Boolean visualizeZ) (at ./Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiFaceLandmarkListAnnotation.cs:109)
Mediapipe.Unity.FaceLandmarkerResultAnnotationController.SyncNow () (at ./Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkerResultAnnotationController.cs:39)
Mediapipe.Unity.AnnotationController`1[T].LateUpdate () (at ./Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/AnnotationController.cs:74)

Steps to Reproduce the Bug

After importing the Unitypackage into Unity and opening the Samples/Scenes/Tasks/FaceLandmarkDetection scene, this issue sometimes occurs after playing the game for a while. It does not always happen. The time it takes for this to occur seems to be random and does not happen at a fixed interval every time. However, in most cases, this issue occurs within 10 minutes.

Log

InvalidOperationException: Collection was modified; enumeration operation may not execute.
System.Collections.Generic.List1+Enumerator[T].MoveNextRare () (at <eef08f56e2e042f1b3027eca477293d9>:0) System.Collections.Generic.List1+Enumerator[T].MoveNext () (at :0)
Mediapipe.Unity.FaceLandmarkListWithIrisAnnotation.PartitionLandmarkList[T] (System.Collections.Generic.IReadOnlyList1[T] landmarks) (at ./Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkListWithIrisAnnotation.cs:176) Mediapipe.Unity.FaceLandmarkListWithIrisAnnotation.Draw (System.Collections.Generic.IReadOnlyList1[T] target, System.Boolean visualizeZ, System.Int32 circleVertices) (at ./Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkListWithIrisAnnotation.cs:116)
Mediapipe.Unity.FaceLandmarkListWithIrisAnnotation.Draw (Mediapipe.Tasks.Components.Containers.NormalizedLandmarks target, System.Boolean visualizeZ, System.Int32 circleVertices) (at ./Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkListWithIrisAnnotation.cs:127)
Mediapipe.Unity.MultiFaceLandmarkListAnnotation+<>c__DisplayClass18_0.b__0 (Mediapipe.Unity.FaceLandmarkListWithIrisAnnotation annotation, Mediapipe.Tasks.Components.Containers.NormalizedLandmarks target) (at ./Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiFaceLandmarkListAnnotation.cs:111)
Mediapipe.Unity.ListAnnotation1[T].CallActionForAll[TArg] (System.Collections.Generic.IReadOnlyList1[T] argumentList, System.Action2[T1,T2] action) (at ./Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/ListAnnotation.cs:118) Mediapipe.Unity.MultiFaceLandmarkListAnnotation.Draw (System.Collections.Generic.IReadOnlyList1[T] targets, System.Boolean visualizeZ) (at ./Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/MultiFaceLandmarkListAnnotation.cs:109)
Mediapipe.Unity.FaceLandmarkerResultAnnotationController.SyncNow () (at ./Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/FaceLandmarkerResultAnnotationController.cs:39)
Mediapipe.Unity.AnnotationController`1[T].LateUpdate () (at ./Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation/AnnotationController.cs:74)

Screenshot/Video

bug_mediapipe

Additional Context

No response

@emoto-yasushi emoto-yasushi added the type:bug Something isn't working label Aug 20, 2024
@homuler
Copy link
Owner

homuler commented Aug 20, 2024

Maybe the same issue as #1223

@homuler homuler self-assigned this Aug 20, 2024
@homuler
Copy link
Owner

homuler commented Aug 20, 2024

The original issue was closed without being fixed, so it's fine to leave this one open.

@homuler homuler reopened this Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants