-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from hotosm/feature/yolo_v8_v2
Feature : Yolo v8 Seg Integration
- Loading branch information
Showing
40 changed files
with
994 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from .georeferencing import georeference | ||
from .inference import predict, evaluate | ||
from .inference import evaluate, predict | ||
from .postprocessing import polygonize, vectorize | ||
from .preprocessing import preprocess | ||
from .training import train | ||
from .preprocessing import preprocess, yolo_v8_v1 | ||
|
||
# from .training import ramp, yolo_v8_v1 | ||
from .utils import bbox2tiles, tms2img |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
# Patched from ramp-code.scripts.calculate_accuracy.iou created for ramp project by [email protected] | ||
|
||
# Standard library imports | ||
from pathlib import Path | ||
|
||
# Third party imports | ||
import geopandas as gpd | ||
|
||
from ramp.utils.eval_utils import get_iou_accuracy_metrics | ||
try: | ||
# Third party imports | ||
from ramp.utils.eval_utils import get_iou_accuracy_metrics | ||
except ImportError: | ||
print("Ramp eval metrics are not available, Possibly ramp is not installed") | ||
|
||
|
||
def evaluate(test_path, truth_path, filter_area_m2=None, iou_threshold=0.5, verbose=False): | ||
def evaluate( | ||
test_path, truth_path, filter_area_m2=None, iou_threshold=0.5, verbose=False | ||
): | ||
""" | ||
Calculate precision/recall/F1-score based on intersection-over-union accuracy evaluation protocol defined by RAMP. | ||
|
@@ -29,9 +38,9 @@ def evaluate(test_path, truth_path, filter_area_m2=None, iou_threshold=0.5, verb | |
truth_df, test_df = gpd.read_file(str(truth_path)), gpd.read_file(str(test_path)) | ||
metrics = get_iou_accuracy_metrics(test_df, truth_df, filter_area_m2, iou_threshold) | ||
|
||
n_detections = metrics['n_detections'] | ||
n_detections = metrics["n_detections"] | ||
n_truth = metrics["n_truth"] | ||
n_truepos = metrics['true_pos'] | ||
n_truepos = metrics["true_pos"] | ||
n_falsepos = n_detections - n_truepos | ||
n_falseneg = n_truth - n_truepos | ||
agg_precision = n_truepos / n_detections | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from .preprocess import preprocess | ||
from .yolo_v8_v1 import yolo_format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.