serengil / deepface

A Lightweight Face Recognition and Facial Attribute Analysis (Age, Gender, Emotion and Race) Library for Python
https://www.youtube.com/watch?v=WnUVYQP4h44&list=PLsS_1RYmYQQFdWqxQggXHynP1rqaYXv_E&index=1
MIT License
10.85k stars 1.91k forks source link

[BUG]: <DeepFace Library Integration Issue in Android Application> #1259

Closed vinayakvigo closed 2 weeks ago

vinayakvigo commented 2 weeks ago

Before You Report a Bug, Please Confirm You Have Done The Following...

DeepFace's version

0.0.92

Python version

3.8.5

Operating System

windos

Dependencies

Summary When integrating the DeepFace library with an Android application using Python Chaquopy, the verify function generates an error: list indices must be integers or slices, not str. This issue occurs despite the same code running correctly in a Python interpreter.

Environment DeepFace Library Version: 0.0.92 Python Integration Tool: Chaquopy Android Application: Custom-built application using Chaquopy for Python integration Issue Details Error Description:

Error Message: list indices must be integers or slices, not str Occurrence: The error is encountered when invoking the verify function of the DeepFace library within the Android environment. Behavior:

The code executes without issues in a standalone Python interpreter. The same code, when executed in the Android application through Chaquopy, results in the mentioned error. Steps to Reproduce:

Integrate the DeepFace library in an Android application using Chaquopy. Configure the application and ensure the library is installed successfully. Execute the verify function with valid image paths or URLs. Observe the error: list indices must be integers or slices, not str. Debugging Attempts:

Verified that the input variables passed to the verify function are correct and match the expected types. Tried using both local storage image paths and online image URLs as input. Ensured that the latest version of the DeepFace library (0.0.92) is being used.

Expected Behavior The verify function should execute without errors and return the verification results.

Actual Behavior The verify function raises an error: list indices must be integers or slices, not str.

Request Please investigate and resolve this issue to ensure the verify function works correctly within the Android application using Chaquopy. Any insights or fixes would be greatly appreciated.

s6 s5 s2 s4 s3 s1

Reproducible example

from deepface import DeepFace

# Sample images for verification
img1_path = "image1.jpg"  # Local storage path
img2_path = "image2.jpg"  

# Verify function call
try:
    result = DeepFace.verify(img1_path, img2_path)
    print(result)
except Exception as e:
    print(f"Error: {e}")

Relevant Log Output

error : list indices must be integers or slices, not str

Expected Result

The verify function should execute without errors and return the verification results.

What happened instead?

The verify function raises an error: list indices must be integers or slices, not str.

Additional Info

If you require any further details or logs, please let me know. Thank you for your assistance!

serengil commented 2 weeks ago

If no issue in regular python, then it means no bug.

Deepface has no support for android. You may consider to open this issue in Chaquopy repo.