Skip to content

Commit

Permalink
Don't use a manifest for the yolo inference
Browse files Browse the repository at this point in the history
  • Loading branch information
rafelafrance committed Mar 8, 2024
1 parent e65f3b8 commit 41fb27a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The images of herbarium sheets come in all different sizes. The model is trained
#### Example

```bash
yolo-inference --sheet-csv /path/to/herbarium/sheets --yolo-images /path/to/yolo/inference --yolo-size 640
yolo-inference --sheet-dir /path/to/herbarium/sheets --yolo-images /path/to/yolo/inference --yolo-size 640
```

### Run the YOLO model
Expand Down
8 changes: 2 additions & 6 deletions finder/yolo_inference_data.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3
import argparse
import csv
import textwrap
from pathlib import Path

Expand All @@ -16,12 +15,9 @@ def main():

args.yolo_images.mkdir(exist_ok=True, parents=True)

with args.sheet_csv.open() as csv_file:
reader = csv.DictReader(csv_file)
sheets = [r["path"] for r in reader]
sheets = list(args.sheet_dir.glob("*"))

for path in tqdm(sheets):
path = Path(path)
sheet_util.to_yolo_image(path, args.yolo_images, args.yolo_size)

log.finished()
Expand All @@ -41,7 +37,7 @@ def parse_args():
)

arg_parser.add_argument(
"--sheet-csv",
"--sheet-dir",
type=Path,
metavar="PATH",
required=True,
Expand Down

0 comments on commit 41fb27a

Please sign in to comment.