Clean up README.md, remove redundancies and fix code#229
Clean up README.md, remove redundancies and fix code#229ganji759 wants to merge 1 commit intometa-pytorch:mainfrom
Conversation
|
@claude review |
There was a problem hiding this comment.
Pull request overview
Updates the Android YOLO/ExecuTorch README to remove duplicated content and present a clearer end-to-end workflow for downloading, converting, and deploying the models.
Changes:
- Reformat README into a 5-step flow with clearer headings and code blocks.
- Fix broken YOLO download snippets by adding the missing
ultralytics.YOLOusage. - Clean up stray/duplicated text and improve section formatting (ADB instructions, feature lists).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| from transformers import AutoModelForImageClassification | ||
| import json | ||
|
|
||
| model = AutoModelForImageClassification.from_pretrained('./bird_classifier_model') |
There was a problem hiding this comment.
extract_species_names.py loads the classifier from ./bird_classifier_model, but Step 1 downloads/uses chriamue/bird-species-classifier and never creates a bird_classifier_model directory. This makes Step 4 non-runnable as written. Align Step 4 with Step 1 (load from the same HuggingFace repo), or explicitly add a Step 1 artifact-save (e.g., model.save_pretrained('./bird_classifier_model')) and reference that path consistently.
| model = AutoModelForImageClassification.from_pretrained('./bird_classifier_model') | |
| model = AutoModelForImageClassification.from_pretrained("chriamue/bird-species-classifier") |
| ### Step 2: Download YOLO Detection Model | ||
|
|
||
| Install Ultralytics: | ||
| The app supports both YOLOv8 and YOLOv26, and automatically detects which version you're using based on the model output format. | ||
|
|
||
| ``` | ||
| ```bash | ||
| pip install ultralytics | ||
| ``` | ||
|
|
||
| ### Download model | ||
|
|
||
| #### Option 1: v8 | ||
| python -c " | ||
| from ultralytics import | ||
| model = ('v8n.pt') # nano version for mobile | ||
| print('v8 model downloaded') | ||
| " | ||
| ``` | ||
|
|
||
| #### Option 2: v26 (Recommended - Faster & More Accurate) | ||
| python -c " | ||
| from ultralytics import | ||
| model = ('26n.pt') # nano version for mobile | ||
| print('v26 model downloaded') | ||
| " | ||
| #### Option 1: YOLOv8 | ||
| ```python | ||
| from ultralytics import YOLO | ||
| model = YOLO('yolov8n.pt') # nano version for mobile | ||
| print('YOLOv8 model downloaded') | ||
| ``` |
There was a problem hiding this comment.
Step 2 shows Python snippets for downloading YOLO weights, but doesn’t say how to execute them (they’re not a complete command like python -c ... nor a script to run). Consider either turning these into runnable commands / a small download_yolo.py + python download_yolo.py, or removing Step 2 entirely since Step 3 already loads the weights via YOLO('...') which will trigger a download if missing.
| ```bash | ||
| pip install ultralytics | ||
| ``` | ||
|
|
There was a problem hiding this comment.
pip install ultralytics is listed both in Prerequisites and again in Step 2. To keep the flow concise and avoid redundancy, remove one of these (typically keep all installs in Prerequisites, and have Step 2 focus only on the download action).
| ```bash | |
| pip install ultralytics | |
| ``` |
Fixes made: