-
Notifications
You must be signed in to change notification settings - Fork 708
Add CV NPU inference example to notebook #736
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this file work on npu?
https://github.com/NexaAI/nexa-sdk/blob/main/examples/python/cv_ocr.py
| "cell_type": "markdown", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "## 4. CV (Computer Vision) NPU Inference\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect number,4 has exist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
examples/python/npu.ipynb
Outdated
| " print(\"=== CV NPU Inference Example ===\")\n", | ||
| " \n", | ||
| " # Model configuration\n", | ||
| " model_name = \"NexaAI/paddle-ocr-mlx\" # Example CV model for OCR\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not npu models, do u had test this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds NPU (Neural Processing Unit) inference support for computer vision tasks, specifically OCR (Optical Character Recognition), to the existing notebook demonstrating NPU capabilities. The change expands the notebook's examples to include CV alongside existing LLM, VLM, Embedder, Reranker, and ASR functionalities.
Key Changes
- Added CV model installation instructions and import statement
- Implemented a comprehensive CV NPU inference example with OCR text detection and recognition
- Included timing metrics and result visualization for CV inference
Comments suppressed due to low confidence (2)
examples/python/npu.ipynb:1
- Corrected comment label from 'ASR model' to 'CV model' to match the actual model type being pulled (paddleocr-npu).
{
examples/python/npu.ipynb:1
- Model name mismatch: the code uses 'NexaAI/paddle-ocr-mlx' but the prerequisites section specifies 'NexaAI/paddleocr-npu'. These should be consistent - either both should reference the MLX version or both should reference the NPU version.
{
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
python has moved to bindings folder, need rebase main to resolve confilics. |
00ed60a to
22b06c1
Compare
|
@mengshengwu please review and directly merge after your changes |
No description provided.