[go: nahoru, domu]

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

Dev #49

Merged
merged 26 commits into from
May 7, 2018
Merged

Dev #49

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
fix
  • Loading branch information
taraspiotr committed May 1, 2018
commit 99b0d44cbd68261dde5f39793a6a4d8200e704de
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def _train(pipeline_name, dev_mode):
meta = pd.read_csv(os.path.join(params.meta_dir, 'stage{}_metadata.csv'.format(params.competition_stage)),
low_memory=False)
meta_train = meta[meta['is_train'] == 1]
meta_valid = meta[meta['is_train'] == 1]
meta_valid = meta[meta['is_valid'] == 1]

if dev_mode:
meta_train = meta_train.sample(20, random_state=1234)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ pandas==0.22.0
imageio==2.2.0
pydot_ng==1.0.0
opencv_python==3.4.0.12
torch==0.2.0.post3
attrdict==2.0.0
scipy==1.0.0
scikit_image==0.13.1
torchvision==0.2.0
torch==0.2.0
numpy==1.14.0
imgaug==0.2.5
neptune_cli==2.8.0
Expand Down
4 changes: 0 additions & 4 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
from tqdm import tqdm
import tempfile


def read_yaml(filepath):
Expand Down Expand Up @@ -91,7 +90,6 @@ def create_submission(meta, predictions, logger, category_ids, save=False, exper
:return: submission if save==False else True
'''
annotations = []
annotations_counter = 1
logger.info('Creating submission')
for image_id, prediction in zip(meta["ImageId"].values, predictions):
score = 1.0
Expand All @@ -100,15 +98,13 @@ def create_submission(meta, predictions, logger, category_ids, save=False, exper
masks = decompose(category_instances)
for mask_nr, mask in enumerate(masks):
annotation = {}
annotation["id"] = annotations_counter
annotation["image_id"] = int(image_id)
annotation["category_id"] = category_ids[category_nr]
annotation["score"] = score
annotation["segmentation"] = rle_from_binary(mask.astype('uint8'))
annotation['segmentation']['counts'] = annotation['segmentation']['counts'].decode("UTF-8")
annotation["bbox"] = bounding_box_from_rle(rle_from_binary(mask.astype('uint8')))
annotations.append(annotation)
annotations_counter += 1
if save:
submission_filepath = os.path.join(experiment_dir, 'submission.json')
with open(submission_filepath, "w") as fp:
Expand Down