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

Upgrade to JEP 4.2.0 #2253

Open
aberenguel opened this issue Jun 28, 2024 · 30 comments
Open

Upgrade to JEP 4.2.0 #2253

aberenguel opened this issue Jun 28, 2024 · 30 comments
Labels
dependencies Pull requests that update a dependency file

Comments

@aberenguel
Copy link
Contributor

Using Ubuntu 24.04 with latest IPED (master d436a74), profile pedo.

The error occurred in the end of processing.

2024-06-28 03:26:28     [INFO]  [engine.core.Manager]                   Changed to processing queue with priority 1
2024-06-28 03:26:28     [INFO]  [engine.data.IPEDSource]                        Opening index /xxxxxxxxx/iped/index
2024-06-28 03:26:51     [INFO]  [engine.data.IPEDSource]                        Index opened
2024-06-28 03:26:51     [INFO]  [engine.data.IPEDSource]                        Creating LuceneId to ID mapping...
java.lang.RuntimeException: double[]
        at iped.engine.data.IPEDSource.<init>(IPEDSource.java:252)
        at iped.engine.data.IPEDSource.<init>(IPEDSource.java:161)
        at iped.engine.search.ItemSearcher.<init>(ItemSearcher.java:29)
        at iped.engine.core.Manager.monitorProcessing(Manager.java:622)
        at iped.engine.core.Manager.process(Manager.java:298)
        at iped.app.processing.Main.startManager(Main.java:178)
        at iped.app.processing.Main.execute(Main.java:240)
        at iped.app.processing.Main.main(Main.java:308)
Caused by: java.lang.ClassNotFoundException: double[]
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:315)
        at iped.engine.task.index.IndexItem.loadMetadataTypes(IndexItem.java:220)
        at iped.engine.data.IPEDSource.<init>(IPEDSource.java:236)
        ... 7 more
2024-06-28 03:26:57     [ERROR] [app.processing.Main]                   Processing Error: 
java.lang.RuntimeException: double[]
        at iped.engine.data.IPEDSource.<init>(IPEDSource.java:252) ~[iped-engine-4.2-snapshot.jar:?]
        at iped.engine.data.IPEDSource.<init>(IPEDSource.java:161) ~[iped-engine-4.2-snapshot.jar:?]
        at iped.engine.search.ItemSearcher.<init>(ItemSearcher.java:29) ~[iped-engine-4.2-snapshot.jar:?]
        at iped.engine.core.Manager.monitorProcessing(Manager.java:622) ~[iped-engine-4.2-snapshot.jar:?]
        at iped.engine.core.Manager.process(Manager.java:298) ~[iped-engine-4.2-snapshot.jar:?]
        at iped.app.processing.Main.startManager(Main.java:178) [iped.jar:?]
        at iped.app.processing.Main.execute(Main.java:240) [iped.jar:?]
        at iped.app.processing.Main.main(Main.java:308) [iped.jar:?]
Caused by: java.lang.ClassNotFoundException: double[]
        at java.lang.Class.forName0(Native Method) ~[?:?]
        at java.lang.Class.forName(Class.java:315) ~[?:?]
        at iped.engine.task.index.IndexItem.loadMetadataTypes(IndexItem.java:220) ~[iped-engine-4.2-snapshot.jar:?]
        at iped.engine.data.IPEDSource.<init>(IPEDSource.java:236) ~[iped-engine-4.2-snapshot.jar:?]
        ... 7 mor
@aberenguel
Copy link
Contributor Author

Trying to continue with --continue leads to the same error.

@wladimirleite
Copy link
Member

Does it work with IPED 4.1.x?
Can you share the image with me so I can take a closer look?

@aberenguel
Copy link
Contributor Author

I investigated and found that the file iped/conf/metadataTypes.txt in the case has the following line:

face_encodings = double[]

@aberenguel
Copy link
Contributor Author

aberenguel commented Jun 28, 2024

Does it work with IPED 4.1.x?

I haven't tested yet.

Can you share the image with me so I can take a closer look?

The image has 900 GB. Should I share locally with you?

@wladimirleite
Copy link
Member

wladimirleite commented Jun 28, 2024

I investigated and found that the file iped/conf/metadataTypes.txt in the case has the following line:

face_encodings = double[]

Try to remove this line. I don't see it in my local version of this file, neither in the master branch.

@aberenguel
Copy link
Contributor Author

Some tests in Java:

System.out.println(double[].class.getName()); // outputs "[D"
System.out.println(double[].class.getCanonicalName());  // outputs "double[]"

Class.forName("[D"); // returns double[]
Class.forName("double[]"); // throws ClassNotFoundException

@aberenguel
Copy link
Contributor Author

I investigated and found that the file iped/conf/metadataTypes.txt in the case has the following line:

face_encodings = double[]

Try to remove this line. I don't see it in my local version of this file, neither in the master branch.

This line is only in the metadataTypes.txt file of the case. I set enableFaceRecognition = true.

@aberenguel
Copy link
Contributor Author

I think the bug can be here:

props.setProperty(e.getKey(), e.getValue().getCanonicalName());

@aberenguel
Copy link
Contributor Author

I investigated and found that the file iped/conf/metadataTypes.txt in the case has the following line:

face_encodings = double[]

Try to remove this line. I don't see it in my local version of this file, neither in the master branch.

I replaced by face_encodings = [D and worked!

@aberenguel aberenguel changed the title Error processing DD ClassNotFoundException parsing metadataTypes.txt Jun 28, 2024
@wladimirleite
Copy link
Member

There are no arrays in metadataTypes.txt.
I guess it should either ignore (not save in the file) array values, or set it as the corresponding object wrapper class of the array elements (in this case java.lang.Double).

@lfcnassif
Copy link
Member

lfcnassif commented Jun 28, 2024

face_encodings = double[]

Arrays shouldn't appear into metadataTypes.txt.

or set it as the corresponding object wrapper class of the array elements (in this case java.lang.Double).

I think this is the best approach.

@lfcnassif lfcnassif added the bug label Jun 28, 2024
@lfcnassif
Copy link
Member

I'll try to reproduce the issue here, I think it happens when the first image where a face is detected have 2 or more faces. If the first image has 1 face, it works with later images with 2+ faces.

@lfcnassif lfcnassif self-assigned this Jun 28, 2024
@wladimirleite
Copy link
Member

This line is only in the metadataTypes.txt file of the case. I set enableFaceRecognition = true.

@aberenguel, is it an "--append"?

@lfcnassif
Copy link
Member

@aberenguel what is the jep python lib version you installed on Linux?

@aberenguel
Copy link
Contributor Author

--append

No. It is the first evidence.

@lfcnassif
Copy link
Member

lfcnassif commented Jun 28, 2024

I processed a case with a single image with 2 faces and I didn't reproduce. The mapping into conf/metadataTypes.txt is:
face_encodings = jep.NDArray

Not sure from where that double[] is coming from...

@aberenguel
Copy link
Contributor Author

@aberenguel what is the jep python lib version you installed on Linux?

I'm using Python virtual environments. It used jep 4.0.3: ./lib/python3.12/site-packages/jep/jep-4.0.3.jar

@lfcnassif
Copy link
Member

You didn't change FaceRecognitionTask.py code, right?

@aberenguel
Copy link
Contributor Author

You didn't change FaceRecognitionTask.py code, right?

No. It was not modified.

@aberenguel
Copy link
Contributor Author

I wonder if it is thing related to Python 3.12.

@lfcnassif lfcnassif added need info and removed bug labels Jun 28, 2024
@aberenguel
Copy link
Contributor Author

Processing a folder with this single file triggers this issue.
0317_Crime_Boss_Rockay_City

@lfcnassif
Copy link
Member

lfcnassif commented Jun 28, 2024

I wasn't able to reproduce on Windows with image above, IPED detected 7 faces in that image with the correct type:
face_encodings = jep.NDArray

Please @aberenguel try to reproduce on Linux with python 3.9 and numpy 1.x (not 2.0), the same used on Windows.

@aberenguel
Copy link
Contributor Author

Please @aberenguel try to reproduce on Linux with python 3.9 and numpy 1.x (not 2.0), the same used on Windows.

Ubuntu 24.04 has only python 3.12. I'll try to get python 3.9 in other way.
Btw, the numpy is version 1.26.4.

@lfcnassif
Copy link
Member

lfcnassif commented Jun 28, 2024

Try to use conda, you can install different python versions with it.

aberenguel added a commit to aberenguel/IPED that referenced this issue Jun 28, 2024
aberenguel added a commit to aberenguel/IPED that referenced this issue Jun 28, 2024
aberenguel added a commit to aberenguel/IPED that referenced this issue Jun 28, 2024
@lfcnassif lfcnassif removed their assignment Jun 29, 2024
@lfcnassif
Copy link
Member

@aberenguel have you confirmed this happens because of python 3.12? Does it work with previous python versions?

@aberenguel
Copy link
Contributor Author

@aberenguel have you confirmed this happens because of python 3.12? Does it work with previous python versions?

I've just tested with Python 3.9.19 (fresh installing modules jep==4.0.3, tensorflow, face_recognition and bs4).
The error was the same.

I get some old cases I processed in Ubuntu 22.04 and they have face_encodings = jep.NDArray.
So I think it is not related to Python version.

@aberenguel
Copy link
Contributor Author

aberenguel commented Jun 29, 2024

Another test I've just done.
I upgraded the jep to version 4.2.0 (in pom.xml and with pip).
There is no error anymore and the case was generated with face_encodings = jep.NDArray.

@lfcnassif
Copy link
Member

I upgraded the jep to version 4.2.0 (in pom.xml and with pip).

Great! I was just going to ask you to try that :-)

@aberenguel
Copy link
Contributor Author

Confirmed that JEP 4.2.0 solved the problem with Python 3.9 and 3.12

@lfcnassif lfcnassif changed the title ClassNotFoundException parsing metadataTypes.txt Upgrade to JEP 4.2.0 Jun 29, 2024
@lfcnassif lfcnassif added enhancement dependencies Pull requests that update a dependency file and removed need info enhancement labels Jun 29, 2024
@patrickdalla
Copy link
Collaborator

Great, @aberenguel , thank you for testing.
JEP 4.2 has some important improvements, mainly "Java Methods can be Annotated to accept Python kwargs", that will be very useful in Aleapp integration.
I have made some workaround code for ALeapp bridge task working with the old JEP version, but I think I can remove them with JEP 4.2 and make a cleaner and less complex integration code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

4 participants