Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Use symlink for output_template/python/lmnet/utils/output.py #688

Merged
merged 6 commits into from
Dec 26, 2019

Conversation

yd8534976
Copy link
Contributor

@yd8534976 yd8534976 commented Dec 18, 2019

Related to: #684 .

Motivation and Context

Description

How has this been tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature / Optimization (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@blueoil-butler blueoil-butler bot added the CI: auto-run Run CI automatically label Dec 18, 2019
@yd8534976 yd8534976 changed the title [WIP] Use symlink for output_template/python/lmnet/utils/output.py Use symlink for output_template/python/lmnet/utils/output.py Dec 20, 2019
@bo-code-review-bot
Copy link

This PR needs Approvals as follows.

  • Ownership Approval for / from iizukak, tkng, ruimashita
  • Readability Approval for Python from tkng, tsawada

Please choose reviewers and requet reviews!

Click to see how to approve each reviews

You can approve this PR by triggered comments as follows.

  • Approve all reviews requested to you (readability and ownership) and LGTM review
    Approval, LGTM

  • Approve all ownership reviews
    Ownership Approval or OA

  • Approve all readability reviews
    Readability Approval or RA

  • Approve specified review targets

    • Example of Ownership Reviewer of /: Ownership Approval for / or OA for /
    • Example of Readability Reviewer of Python: Readability Approval for Python or RA for Python
  • Approve LGTM review
    LGTM

See all trigger comments

Please replace [Target] to review target

  • Ownership Approval
    • Ownership Approval for [Target]
    • OA for [Target]
    • Ownership Approval
    • OA
    • Approval
  • Readability Approval
    • Readability Approval for [Target]
    • RA for [Target]
    • [Target] Readability Approval
    • [Target] RA
    • Readability Approval
    • RA
    • Approval
  • LGTM
    • LGTM
    • lgtm

@tsawada tsawada removed their request for review December 23, 2019 08:10
@tsawada
Copy link
Contributor

tsawada commented Dec 23, 2019

Please put me back after ownership review.

Copy link
Member

@iizukak iizukak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ownership Approval

@yd8534976 yd8534976 requested a review from tsawada December 23, 2019 08:13
Copy link
Contributor

@tsawada tsawada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need these diffs in predict_output/output.py in order to replace output_template/.../output.py with a symlink?

@yd8534976
Copy link
Contributor Author

yd8534976 commented Dec 23, 2019

@tsawada , Thanks!
Since there are some differences between two files.

  1. For example, we have no matplotlib in output_template/requirements.txt.

    from matplotlib import cm

    click==6.7
    easydict==1.6
    numpy==1.14.0
    Pillow==6.2.1
    PyYAML==4.2b4
    # for python2
    enum34==1.1.6
    six==1.11.0

  2. There is no bench in predict_output/output.py's __init__().

    def __init__(self, task, classes, image_size, data_format, bench={}):
    assert task in Tasks
    self.task = task
    self.classes = classes
    self.image_size = image_size
    self.data_format = data_format
    self.bench = {}

    def __init__(self, task, classes, image_size, data_format):
    assert task in Tasks
    self.task = task
    self.classes = classes
    self.image_size = image_size
    self.data_format = data_format

So I synchronized it manually.

@@ -35,12 +34,13 @@ class JsonOutput():
Please see [Output Data Specification](https://github.com/LeapMind/lmnet/wiki/Output-Data-Specification).
"""

def __init__(self, task, classes, image_size, data_format):
def __init__(self, task, classes, image_size, data_format, bench={}):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use mutable object as an argument's default value
http://go/python-review-guidelines#using-listdict-as-the-default-arg

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, it is reasonable. Fixed.

from io import BytesIO

import numpy as np
import PIL.Image
import PIL.ImageDraw
from matplotlib import cm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove matplotlib from requirements.txt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After this PR, only lmnet/networks/classification/base.py will depend on matplotlib.

from matplotlib import cm

Is it worth adding a new dependency for visualization? If not, I would remove it in another PR and reimplement this.
Related to: #485

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I think it'd be nice.

Copy link
Contributor

@tsawada tsawada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Readability Approval

from io import BytesIO

import numpy as np
import PIL.Image
import PIL.ImageDraw
from matplotlib import cm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I think it'd be nice.

@yd8534976 yd8534976 merged commit e156424 into blue-oil:master Dec 26, 2019
@yd8534976 yd8534976 deleted the symbolic_link_for_output branch December 26, 2019 04:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI: auto-run Run CI automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants