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

Build failed and Cmake Error when try to install ultralytics #1102

Closed
rovedashcam opened this issue Feb 28, 2024 · 2 comments
Closed

Build failed and Cmake Error when try to install ultralytics #1102

rovedashcam opened this issue Feb 28, 2024 · 2 comments
Labels

Comments

@rovedashcam
Copy link

rovedashcam commented Feb 28, 2024

Process 'command '/Users/cdp/AndroidStudioProjects/chaquopy-matplotlib/app/build/python/env/debug/bin/python'' finished with non-zero exit value 1
I am trying to read python code using Android kotlin code i am able to read simple sum code but some code which is read based on library so i am unable to read it

import json
import pandas as pd
from ultralytics import YOLO
model = YOLO("file:///android_asset/YoloV8_model.pt")
def detectOCR(imagePath):
    try:
        results = model(imagePath)
        df = pd.DataFrame(results[0].boxes.data)
        df.sort_values(by=[0], inplace=True)
        df.reset_index(inplace=True, drop=True)

        output = ""
        kwh = False
        names = results[0].names

        for i in range(len(df)):
            if names[int(df[5][i])] == "kwh":
                kwh = True
                continue
            output += names[int(df[5][i])]
        if kwh:
            output += " kwh"
        return json.dumps({"status": "success", "msg": "successfully processed", "result": output})
    except:
        return "error"

This is python code for this we need install ultralytics and pandas
both library installed i install like using build.gradle file .

 python {
            version '3.8'
            pip {
              //  install "matplotlib"
                install "pandas"
          //      install "torch"
        //       install "YOLO"
                install "ultralytics"
            }
        }

please suggest me where i am doing wrong and what i am doing wrong .

Thanks

@rovedashcam rovedashcam changed the title Build failed and Cmake Error when try to install python library Build failed and Cmake Error when try to install python library to read python code using Android kotlin code Feb 28, 2024
@mhsmith mhsmith changed the title Build failed and Cmake Error when try to install python library to read python code using Android kotlin code Build failed and Cmake Error when try to install ultralytics Feb 28, 2024
@mhsmith
Copy link
Member

mhsmith commented Feb 28, 2024

The error is:

ERROR: Failed to install opencv-python>=4.6.0 from https://files.pythonhosted.org/packages/c0/52/9fe76a56e01078a612812b40764a7b138f528b503f7653996c6cfadfa8ec/opencv-python-4.8.1.78.tar.gz#sha256=cc7adbbcd1112877a39274106cb2752e04984bc01a031162952e97450d6117f6 (from ultralytics).

The newest version of ultralytics which is compatible with our current opencv and numpy packages is:

            install "ultralytics==8.0.16"
            install "seaborn==0.12.2"

To be notified when we upgrade opencv, please subscribe to #620.

@mhsmith mhsmith closed this as completed Feb 28, 2024
@mhsmith mhsmith reopened this Feb 29, 2024
@chaquo chaquo deleted a comment from rovedashcam Mar 5, 2024
@chaquo chaquo deleted a comment from rovedashcam Mar 5, 2024
@chaquo chaquo deleted a comment from rovedashcam Mar 5, 2024
@chaquo chaquo deleted a comment from rovedashcam Mar 5, 2024
@chaquo chaquo deleted a comment from rovedashcam Mar 5, 2024
@mhsmith
Copy link
Member

mhsmith commented Mar 5, 2024

The rest of the conversation is unrelated to the original question, so I've moved it to #1106. Please continue there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants