Open pierluigizagaria opened 1 year ago
I'm seeing the exact same issue
Sorry, somehow, I didn't see this post before. The reason is that the default build and custom builds are not compatible. Neural networks return the vectors of different sizes, so we can't calculate the similarity of faces that are stored in different builds. So you need to start with a clear database. The easiest way is to put docker compose config in a folder with a different name. By default, the release archive contains custom builds that are stored in folders with different names, so if you just open the folder and run 'docker compose up' in them, it should work
@pospielov thanks for the reply. I'm only seeing this issue with mobilenet when I tested with SubCenter-ArcFace-r100 I don't have this issue and double-take is able to connect. I only keep settings when switching between builds.
Great, so we know the problem. In my previous response, I explained the steps to initiate CompreFace using a clean database. Feel free to let me know if you encounter any difficulties with this process.
@pospielov I tried the clean mobilenet 1.2.0 by running from the preset custom-builds/Mobilenet folder and saw same logs from compreface-api .
I built my custom compreface-core image to use non-CUDA non-AVX mxnet library (by specifying 'mxnet==1.9.1'
here as mentioned in this comment). I also added a single rule to this [Makefile]() to only build mobilenet. Other images were pulled from hub.docker.com by docker compose up
.
Then I visited the web-UI and clicked "Try Demo". When I uploaded a picture with no face, compreface returned No face is found in the given image
successfully. But when I uploaded a picture with face, compreface returned Something went wrong, please try again
.
compreface-api logs:
compreface-api | 2023-11-08 08:42:42.529 ERROR 7 --- [nio-8080-exec-3] c.e.f.c.h.ResponseExceptionHandler : Undefined exception occurred compreface-api | compreface-api | java.lang.IllegalStateException: Cannot perform operation "subi" - shapes are not equal and are not broadcastable.first.shape=[20, 512], second.shape=[128] compreface-api | at org.nd4j.common.base.Preconditions.throwStateEx(Preconditions.java:641) compreface-api | at org.nd4j.common.base.Preconditions.checkState(Preconditions.java:376) compreface-api | at org.nd4j.linalg.api.shape.Shape.assertBroadcastable(Shape.java:265) compreface-api | at org.nd4j.linalg.api.ndarray.BaseNDArray.subi(BaseNDArray.java:3238) compreface-api | at org.nd4j.linalg.api.ndarray.BaseNDArray.subi(BaseNDArray.java:3225) compreface-api | at com.exadel.frs.core.trainservice.component.classifiers.EuclideanDistanceClassifier.euclidean_distance(EuclideanDistanceClassifier.java:147) compreface-api | at com.exadel.frs.core.trainservice.component.classifiers.EuclideanDistanceClassifier.recognize(EuclideanDistanceClassifier.java:130) compreface-api | at com.exadel.frs.core.trainservice.component.classifiers.EuclideanDistanceClassifier.predict(EuclideanDistanceClassifier.java:58) compreface-api | at com.exadel.frs.core.trainservice.component.FaceClassifierPredictor.predict(FaceClassifierPredictor.java:34) compreface-api | at com.exadel.frs.core.trainservice.service.FaceRecognizeProcessServiceImpl.processFaceResult(FaceRecognizeProcessServiceImpl.java:82) compreface-api | at com.exadel.frs.core.trainservice.service.FaceRecognizeProcessServiceImpl.processImage(FaceRecognizeProcessServiceImpl.java:72) compreface-api | at com.exadel.frs.core.trainservice.service.FaceRecognizeProcessServiceImpl.processImage(FaceRecognizeProcessServiceImpl.java:25) compreface-api | at com.exadel.frs.core.trainservice.controller.RecognizeController.recognize(RecognizeController.java:113) compreface-api | at com.exadel.frs.core.trainservice.controller.RecognizeController$$FastClassBySpringCGLIB$$52b4c4f5.invoke(<generated>) compreface-api | at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) compreface-api | at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793) compreface-api | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) compreface-api | at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) compreface-api | at org.springframework.validation.beanvalidation.MethodValidationInterceptor.invoke(MethodValidationInterceptor.java:123) compreface-api | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) compreface-api | at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) compreface-api | at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708) compreface-api | at com.exadel.frs.core.trainservice.controller.RecognizeController$$EnhancerBySpringCGLIB$$f9daa919.recognize(<generated>) compreface-api | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) compreface-api | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) compreface-api | at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) compreface-api | at java.base/java.lang.reflect.Method.invoke(Unknown Source) compreface-api | at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) compreface-api | at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) compreface-api | at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) compreface-api | at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) compreface-api | at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) compreface-api | at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) compreface-api | at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067) compreface-api | at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963) compreface-api | at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) compreface-api | at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) compreface-api | at javax.servlet.http.HttpServlet.service(HttpServlet.java:681) compreface-api | at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) compreface-api | at javax.servlet.http.HttpServlet.service(HttpServlet.java:764) compreface-api | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) compreface-api | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) compreface-api | at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) compreface-api | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) compreface-api | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) compreface-api | at com.exadel.frs.core.trainservice.filter.SecurityValidationFilter.doFilter(SecurityValidationFilter.java:134) compreface-api | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) compreface-api | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) compreface-api | at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) compreface-api | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) compreface-api | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) compreface-api | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) compreface-api | at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) compreface-api | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) compreface-api | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) compreface-api | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) compreface-api | at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:96) compreface-api | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) compreface-api | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) compreface-api | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) compreface-api | at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) compreface-api | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) compreface-api | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) compreface-api | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) compreface-api | at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) compreface-api | at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) compreface-api | at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) compreface-api | at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) compreface-api | at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) compreface-api | at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) compreface-api | at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) compreface-api | at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) compreface-api | at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) compreface-api | at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890) compreface-api | at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743) compreface-api | at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) compreface-api | at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) compreface-api | at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) compreface-api | at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) compreface-api | at java.base/java.lang.Thread.run(Unknown Source) compreface-api |
I also tried mobilenet from release archive without any changes. Same behavior.
double-take works fine using compreface-core:1.1.0 but gives error when using compreface-core:1.1.0-mobilenet
When using compreface-core:1.1.0-mobilenet compreface-api returns error 400
and compreface-api returns
while compreface-core seems to work fine