-
Notifications
You must be signed in to change notification settings - Fork 138
WIP: operations: image: Add new image processing operations #731
Conversation
This pull request introduces 1 alert when merging 57b5034 into 000c440 - view on LGTM.com new alerts:
|
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.
Can we also change some of those commit messages:
-
operations: image: update setup.py
->operations: image: Add mahotas as dependency
-
operations: image: Add a combine operation (temporarily)
->operations: image: Temporarily add a combine operation
- Also, if you aren't using this operation within this PR, we shouldn't add it here. Let's add it once we're sure we're using it.
-
df: base: Support default in create_definiton
should be a part of the first commit, usefixup
(f
) to add the changes in that commit to the first commit: https://asciinema.org/a/342828
Also, if your updating resize
here breaks the tutorial, then we need to update the tutorial in this PR. Ideally in the same commit as when it would break. I just modified it, so you'll need to rebase in the changes from master git fetch origin && git rebase origin/master
f30f584
to
9d0d275
Compare
diff --git a/dffml/util/data.py b/dffml/util/data.py
index fecc142d..2d20dbc6 100644
--- a/dffml/util/data.py
+++ b/dffml/util/data.py
@@ -11,6 +11,7 @@ import types
import pydoc
import inspect
import dataclasses
+import collections
from functools import wraps
import pathlib
from typing import Callable
@@ -215,9 +216,9 @@ def export_value(obj, key, value):
obj[key] = value.export()
elif hasattr(value, "_asdict"):
obj[key] = value._asdict()
- elif getattr(
- type(value), "__module__", None
- ) == "numpy" and inspect.ismethod(getattr(value, "flatten", None)):
+ elif getattr(type(value), "__module__", None) == "numpy" and isinstance(
+ getattr(value, "flatten", None), collections.Callable
+ ):
obj[key] = tuple(value.flatten())
elif dataclasses.is_dataclass(value):
obj[key] = export_dict(**dataclasses.asdict(value)) Seems to produce a formatting issue with
Also, a commit for fixing no json output on pretty diff --git a/dffml/cli/list.py b/dffml/cli/list.py
diff --git a/dffml/cli/list.py b/dffml/cli/list.py
index 478047f3..a13f9ec9 100644
--- a/dffml/cli/list.py
+++ b/dffml/cli/list.py
@@ -2,7 +2,7 @@ import pkg_resources
from ..source.source import BaseSource
from ..model import Model
-from ..util.cli.cmd import CMD
+from ..util.cli.cmd import CMD, CMDOutputOverride
from ..util.cli.cmds import SourcesCMD, ListEntrypoint, SourcesCMDConfig
from ..base import config, field
@@ -29,6 +29,8 @@ class ListRecords(SourcesCMD):
print(record)
else:
yield record
+ if self.pretty:
+ yield CMDOutputOverride
class ListServices(ListEntrypoint): |
9d0d275
to
d8eb373
Compare
d8eb373
to
2d2f95c
Compare
Signed-off-by: sakshamarora1 <sakshamarora1001@gmail.com>
Signed-off-by: sakshamarora1 <sakshamarora1001@gmail.com>
…n -pretty is used Fixes: intel#736 Signed-off-by: sakshamarora1 <sakshamarora1001@gmail.com>
Signed-off-by: sakshamarora1 <sakshamarora1001@gmail.com>
- Added new flatten operation - Updated resize operation to have more parameters - Updated the MNIST use case to use flatten and updated resize operation Signed-off-by: sakshamarora1 <sakshamarora1001@gmail.com>
- calcHist - HuMoments - Haralick - normalize - convertcolor Signed-off-by: sakshamarora1 <sakshamarora1001@gmail.com>
Signed-off-by: sakshamarora1 <sakshamarora1001@gmail.com>
2d2f95c
to
1bee8d4
Compare
No description provided.