-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
51 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
from .data_loader import create_data_loader | ||
from .dataset_splits import get_paths | ||
from .heatmap_dataset import HeatmapDataset | ||
from .training import supervised_training | ||
from .prediction import get_prediction_torch_em | ||
from .protein_detection import protein_detection | ||
from .tiling_helper import parse_tiling | ||
from .training.data_loader import create_data_loader | ||
from .training.dataset_splits import get_paths | ||
from .training.heatmap_dataset import HeatmapDataset | ||
from .training.training import supervised_training | ||
from .prediction.prediction import get_prediction_torch_em | ||
from .inference.protein_detection import protein_detection | ||
from .training.tiling_helper import parse_tiling | ||
from .evaluation.evaluation_metrics import metric_coords, get_distance_threshold_from_gridsearch |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
def metric_coords(): | ||
return | ||
|
||
def get_distance_threshold_from_gridsearch(): | ||
return |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import pandas | ||
from tqdm import tqdm | ||
from skimage.feature import blob_log | ||
from ..evaluation.evaluation_metrics import metric_coords, get_distance_threshold_from_gridsearch | ||
|
||
|
||
def gridsearch(): | ||
data = [] | ||
for i in tqdm(range(len(idx))): | ||
image_path = grid_search_image_paths[i] | ||
label_path = grid_search_label_paths[i] | ||
|
||
model, device = load_model(config, in_channels) | ||
preds = predict_image(image_path, model, tuple(config["patch_shape"]), device=device) | ||
label_coords = get_center_coordinates(label_path) | ||
|
||
|
||
for thresh in threshes: | ||
#smalles protein structure: "beta-amylase": 33.27 | ||
#bigges protein structure: "ribosome": 109.02, | ||
#0.3 is the factor to match the PDB size to the experimental data size | ||
adj_factor=0.3 #TODO implement this as an argument, also when creating heatmap | ||
pred_coords = blob_log(preds, min_sigma=33.27*adj_factor, max_sigma=109.02*adj_factor, threshold_abs=thresh) | ||
|
||
|
||
_, _, f1, _, _, _ = metric_coords(label_coords, pred_coords) | ||
data.append([f1, dist, thresh]) | ||
|
||
df = pandas.DataFrame(data=data, columns=["f1", "Distance", "Threshold"]) | ||
dist, thresh = get_distance_threshold_from_gridsearch(df, distances, threshes) | ||
return dist, thresh, grid_search_numbers |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.