Skip to content

Commit

Permalink
update nb for resized images (#27)
Browse files Browse the repository at this point in the history
* update nb for resized images

* update checksum for resized data

* update random_classifier for resized data

* clean object_detector

* clean nb
  • Loading branch information
frcaud authored Dec 6, 2021
1 parent a7810cb commit da3ddac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 24 deletions.
2 changes: 1 addition & 1 deletion download_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
archive_name="public.tar.gz",
# to findout checksum use function
# defined below: hash_folder(folder_path)
data_checksum=2471299081,
data_checksum=1969228298,
),
"private": dict(
code="vw8sh", archive_name="private.tar.gz", data_checksum=756276259
Expand Down
2 changes: 1 addition & 1 deletion follicles_detection_starting_kit.ipynb

Large diffs are not rendered by default.

26 changes: 4 additions & 22 deletions submissions/random_classifier/object_detector.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,4 @@
"""
Result of `ramp-test --submision random_classifier`
total runtime ~30min
----------------------------
Mean CV scores
----------------------------
score AP <Primordial> AP <Primary> AP <Secondary> AP <Tertiary> mean AP time
train 0.001 ± 0.0007 0.023 ± 0.0077 0.375 ± 0.025 0.436 ± 0.0563 0.209 ± 0.0208 130.8 ± 20.49
valid 0.0 ± 0.0 0.037 ± 0.0214 0.332 ± 0.0734 0.458 ± 0.0557 0.207 ± 0.0107 166.2 ± 5.91
test 0.001 ± 0.0018 0.008 ± 0.0141 0.325 ± 0.1782 0.398 ± 0.1259 0.183 ± 0.0683 32.3 ± 0.48
----------------------------
Bagged scores
----------------------------
score AP <Primordial> AP <Primary> AP <Secondary> AP <Tertiary> mean AP
valid 0.000 0.026 0.361 0.626 0.253
test 0.002 0.008 0.475 0.625 0.278
"""

import os
import numpy as np
import tensorflow as tf
Expand Down Expand Up @@ -128,7 +110,7 @@ def fit(self, X_image_paths, y_true_locations):
if os.environ.get("RAMP_TEST_MODE", False):
self._model.fit(X_for_classifier, y_for_classifier, epochs=10)
else:
self._model.fit(X_for_classifier, y_for_classifier, epochs=100)
self._model.fit(X_for_classifier, y_for_classifier, epochs=50)
return self

def predict(self, X):
Expand All @@ -145,11 +127,11 @@ def predict(self, X):
def predict_single_image(self, image_path):
image = imread(image_path)

boxes_sizes = [3000, 1000, 300] # px
boxes_sizes = [1500, 1000, 500] # px
if os.environ.get("RAMP_TEST_MODE", False):
boxes_amount = [10, 10, 10]
else:
boxes_amount = [200, 500, 200]
boxes_amount = [300, 400, 200]
boxes = generate_random_windows_for_image(image, boxes_sizes, boxes_amount)
cropped_images = build_cropped_images(
image, boxes, crop_size=self.IMG_SHAPE[0:2]
Expand Down

0 comments on commit da3ddac

Please sign in to comment.