Hi,
I don't know this library (yolov4), but I briefly looked at the documentation. In my opinion, better solution would be to create a separate Python project for image detection, store results of its work somewhere (e.g. in the database, files, etc.) and then access it from the Java projects. Another solution, may be creating REST webservice in Python, which will be a facade for the yolov4 library and then access it from Java via REST. This library seems to be complicated and uses tensorflow as far as I see. I know that tensorflow works differently with different versions of Python and I'm not really sure if Py4J is compatible with all versions of Python (probably not). Connecting this library with Java via Py4J may be possible, but I think it will be very problematic.
Regards,