-
Notifications
You must be signed in to change notification settings - Fork 11
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
Robodummy #57
Draft
Pranjal-sopho
wants to merge
45
commits into
ilastik:main
Choose a base branch
from
Pranjal-sopho:robodummy
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Robodummy #57
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
5b8c573
robo user first commit
Pranjal-sopho 04e3fd9
Merge pull request #1 from ilastik/master
Pranjal-sopho 73e4c47
some changes
Pranjal-sopho 2dec996
Merge remote-tracking branch 'origin/master' into robodummy
Pranjal-sopho 3d66cbc
structural changes
Pranjal-sopho 7bf8f81
some structural changes
Pranjal-sopho d157d9d
deleted unnecessary files
Pranjal-sopho 39fb936
changed tiling to generic+ apply black
Pranjal-sopho 52d0114
switched to n5 for better mem mang.
Pranjal-sopho 83316c2
incorporated suggestions
Pranjal-sopho 8814e98
added test folder
Pranjal-sopho eb19bb3
indexing now generic and loss configurable
Pranjal-sopho 8220b95
added basic tensorboard logger
Pranjal-sopho 35af962
made changes acc to previous review
Pranjal-sopho ae97dbd
tiling now completely generic+other modifications
Pranjal-sopho 3b8b7d7
bug fixed in tile_image + other changes
Pranjal-sopho 84d61cb
tests now running
Pranjal-sopho 28640d6
Merge pull request #2 from ilastik/master
Pranjal-sopho 997c4eb
more tensorboard logging
Pranjal-sopho d355deb
Merge branch 'master' into obodummy
Pranjal-sopho a9cfecd
tensorboard errors fixed
Pranjal-sopho fd1eb97
new strategy added
Pranjal-sopho cba7191
sparse annotation strategies added
Pranjal-sopho f265faf
video labelling strategies added
Pranjal-sopho fcce3f2
class annotator added
Pranjal-sopho 4daa134
all bugs fixed
Pranjal-sopho 6be7a82
apply black
Pranjal-sopho f38692a
Merge pull request #3 from ilastik/master
Pranjal-sopho 27c4f43
new commit
Pranjal-sopho d1a1cdc
added gitignore
Pranjal-sopho 064c27c
Merge branch 'master' into robodummy
Pranjal-sopho 4c6d9cb
testing..
Pranjal-sopho 3940c55
Update environemnt file to include MrRobot deps
m-novikov 5da186d
Add __init__ and __main__
m-novikov f45d619
Make __main__ work
m-novikov 3db31e9
Fix confusion_matrix nans
m-novikov 79a77da
Fixes to strategies
m-novikov 6bd9d7e
Fix unstopabble predictions of inferno trainer
m-novikov 055d08f
Add train_for method to tiktorch server
m-novikov 3eec9c8
Use train_for in mr_robot
m-novikov 8e907e3
training problems fixed (temporarily)
Pranjal-sopho c6ddc1d
training problems fixed (temporarily)
Pranjal-sopho 617a4df
training problems fixed (temporarily)
Pranjal-sopho 39a674d
updating with code used for result prep
Pranjal-sopho 9050f93
strategy params passed generalized and hardcodings for done for resul…
Pranjal-sopho File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ tiktorch/.idea | |
tiktorch/__pycache/ | ||
/#wrapper.py# | ||
/.#wrapper.py# | ||
.py~ | ||
.py~ | ||
*.hdf | ||
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
Empty file.
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,23 @@ | ||
import argparse | ||
|
||
from mr_robot.mr_robot import MrRobot, strategies | ||
|
||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument("-c", "--config", help="Path to config file", type=str, required=True) | ||
parser.add_argument( | ||
"-s", "--strategy", help="Annotation strategy to use", type=str, choices=strategies.keys(), required=True | ||
) | ||
parser.add_argument("-d", "--device", help="Which device to use", type=str, required=True, default="cpu") | ||
|
||
|
||
def main(): | ||
args = parser.parse_args() | ||
robo = MrRobot(args.config, args.strategy, args.device) | ||
robo._load_model() | ||
robo._run() | ||
return 0 | ||
|
||
|
||
if __name__ == "__main__": | ||
exit(main()) |
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,54 @@ | ||
import numpy as np | ||
import random | ||
|
||
from mr_robot.utils import get_coordinate | ||
|
||
|
||
class Annotater: | ||
""" The annotater class prvides methods for different labelling strategies, emulating a user | ||
in some way | ||
|
||
Args: | ||
annotation_percent (int): percentage of pixels in the patch to annotate | ||
""" | ||
|
||
def __init__(self, annotation_percent): | ||
self.annotation_percent = annotation_percent | ||
# self.block_shape = block_shape | ||
|
||
def get_random_index(self, block_shape): | ||
random_index = [] | ||
for i in range(len(block_shape)): | ||
random_index.append(np.random.randint(0, block_shape[i])) | ||
|
||
return tuple(random_index) | ||
|
||
def get_random_patch(self, block_shape): | ||
rand_index = self.get_random_index(block_shape) | ||
patch_dimension = [] | ||
for i in range(len(block_shape)): | ||
patch_dimension.append(np.random.randint(0, block_shape[i] - rand_index[i])) | ||
|
||
block = [] | ||
for i in range(len(patch_dimension)): | ||
block.append(slice(rand_index[i], rand_index[i] + patch_dimension[i])) | ||
return tuple(block) | ||
|
||
def dense(self, label): | ||
return label | ||
|
||
def random_sparse(self, label): | ||
ret_label = np.zeros(label.shape) | ||
for i in range(int(self.annotation_percent) * np.product(label.shape)): | ||
index = self.get_random_index(label.shape) | ||
ret_label[index] = label[index] | ||
return ret_label | ||
|
||
def random_blob(self, label): | ||
ret_label = np.ones(label.shape) | ||
for i in range(int(self.annotation_percent) * np.product(label.shape)): | ||
random_block = self.get_random_patch(label.shape) | ||
ret_label[random_block] = label[random_block] | ||
i += np.product(label[random_block].shape) | ||
print("random blob annotated label:", np.unique(ret_label), "labels of actual return patch:", np.unique(label)) | ||
return ret_label |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no need to ignore
.nn
and.hdf
files (as there are none in the repo). Pls remove