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

Corrects Error running model from local file on Windows and readme update #5

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ expects an input image with the same features. An example notebook for how the p

**Command line**
```bash
python geo_inference.py -a <args>
python geo_inference -a <args>
```
- `-a`, `--args`: Path to arguments stored in yaml, consult ./config/sample_config.yaml
```bash
python geo_inference.py -i <image> -m <model> -wd <work_dir> -bs <batch_size> -v <vec> -d <device> -id <gpu_id>
python geo_inference -i <image> -m <model> -wd <work_dir> -bs <batch_size> -v <vec> -d <device> -id <gpu_id>
```
- `-i`, `--image`: Path to Geotiff
- `-bb`, `--bbox`: AOI bbox in this format "minx, miny, maxx, maxy" (Optional)
Expand All @@ -52,7 +52,7 @@ python geo_inference.py -i <image> -m <model> -wd <work_dir> -bs <batch_size> -v
You can also use the `-h` option to get a list of supported arguments:

```bash
python geo_inference.py -h
python geo_inference -h
```

**Import script**
Expand Down
2 changes: 1 addition & 1 deletion geo_inference/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def get_model(model_path_or_url: str, work_dir: Path) -> Path:
Path: Path to the model file.
"""
parsed_string = urlparse(model_path_or_url)
if parsed_string.scheme:
if parsed_string.scheme and not os.path.exists(model_path_or_url):
model_url = model_path_or_url
model_name = os.path.basename(parsed_string.path)
cached_file = work_dir.joinpath(model_name)
Expand Down
Loading