williamfzc/stagesepx

View on GitHub
fix(classifier): duplicated ImageDataGenerator #499
williamfzc authored de6bcae5
complete00:00:17
Your first build completed successfully!

Congratulations

Your first build completed successfully!

See the Results

1
git clone
2
codeclimate validate-config
View output
codeclimate validate-config
No errors or warnings found in .codeclimate.json.
3
codeclimate prepare
View output
codeclimate prepare
4
builder pull-engines
View output
determining required images
5
structure
View output
12
Parser process id: 12
codeclimate-parser socket not present
waiting 1s...
6
duplication
View output
12
Parser process id: 12
codeclimate-parser socket not present
waiting 1s...
I, [2024-10-28T07:21:51.159922 #1]  INFO -- : Skipping file ./example/range_check.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 33
    final_result: dict = {}
                ^
SyntaxError: invalid syntax


I, [2024-10-28T07:21:51.171473 #1]  INFO -- : Skipping file ./example/with_keras.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 26
    def create_model(self) -> Sequential:
                           ^
SyntaxError: invalid syntax


I, [2024-10-28T07:21:51.199535 #1]  INFO -- : Skipping file ./example/old/cut.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 59
    print(f'data saved to {data_path}')
                                     ^
SyntaxError: invalid syntax


I, [2024-10-28T07:21:51.259257 #1]  INFO -- : Skipping file ./stagesepx/hook.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 13
    logger.debug(f"start initialing: {self.__class__.__name__} ...")
                                                                  ^
SyntaxError: invalid syntax


I, [2024-10-28T07:21:51.271546 #1]  INFO -- : Skipping file ./stagesepx/api.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 22
    def run(config: typing.Union[dict, str]):
                  ^
SyntaxError: invalid syntax


I, [2024-10-28T07:21:51.271675 #1]  INFO -- : Skipping file ./stagesepx/cli.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 14
    """
      ^
SyntaxError: invalid syntax


I, [2024-10-28T07:21:51.283919 #1]  INFO -- : Skipping file ./stagesepx/video.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 18
    def __init__(self, frame_id: int, timestamp: float, data: np.ndarray):
                               ^
SyntaxError: invalid syntax


I, [2024-10-28T07:21:51.283983 #1]  INFO -- : Skipping file ./stagesepx/reporter.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 23
    def get_template() -> str:
                       ^
SyntaxError: invalid syntax


I, [2024-10-28T07:21:51.297062 #1]  INFO -- : Skipping file ./stagesepx/toolbox.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 24
    def video_capture(video_path: str):
                                ^
SyntaxError: invalid syntax


I, [2024-10-28T07:21:51.308642 #1]  INFO -- : Skipping file ./stagesepx/classifier/svm.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 25
    self, feature_type: str = None, score_threshold: float = None, *args, **kwargs
                      ^
SyntaxError: invalid syntax


I, [2024-10-28T07:21:51.309160 #1]  INFO -- : Skipping file ./stagesepx/classifier/ssim.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 10
    self, frame: VideoFrame, threshold: float = None, *_, **__
               ^
SyntaxError: invalid syntax


I, [2024-10-28T07:21:51.320663 #1]  INFO -- : Skipping file ./stagesepx/classifier/base.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 22
    video_path: str,
              ^
SyntaxError: invalid syntax


I, [2024-10-28T07:21:51.321248 #1]  INFO -- : Skipping file ./stagesepx/classifier/keras.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 38
    score_threshold: float = None,
                   ^
SyntaxError: invalid syntax


I, [2024-10-28T07:21:51.344083 #1]  INFO -- : Skipping file ./stagesepx/cutter/cut_result.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 19
    video: VideoObject,
         ^
SyntaxError: invalid syntax


I, [2024-10-28T07:21:51.348087 #1]  INFO -- : Skipping file ./stagesepx/cutter/cutter.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 16
    step: int = None,
        ^
SyntaxError: invalid syntax


I, [2024-10-28T07:21:51.356076 #1]  INFO -- : Skipping file ./stagesepx/cutter/cut_range.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 16
    video: typing.Union[VideoObject, typing.Dict],
         ^
SyntaxError: invalid syntax
7
bandit
bandit engine documentation
View output
[main]	INFO	profile include tests: None
[main]	INFO	profile exclude tests: None
[main]	INFO	cli include tests: None
[main]	INFO	cli exclude tests: None
[node_visitor]	INFO	Unable to find qualified name for module: setup.py
8
pep8
pep8 engine documentation
View output
.github/ example/ stagesepx/ docs/ setup.py
9
sonar-python
sonar-python engine documentation
View output
INFO: Java 1.8.0_111-internal Oracle Corporation (64-bit)
INFO: Linux 4.4.0-1128-aws amd64
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/src/app/build/libs/sonarlint-core-2.17.0.899.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/src/app/build/libs/sonarlint-cli-2.1.0.566.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
INFO: Index files
INFO: Invalid character encountered in file '/code/docs/pics/ssim_trend.png' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/docs/pics/stage.png' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: 61 files indexed
ERROR: Unable to parse file: /code/example/range_check.py
ERROR: Parse error at line 33 column 12:

   29: cl.train()
   30: classify_result = cl.classify(video_path, stable, keep_data=True)
   31: result_dict = classify_result.to_dict()
   32: 
  -->  final_result: dict = {}
   34: 
   35: for each_stage, each_frame_list in result_dict.items():
   36: 
   37: 
   38: 
   39:     middle_id: int = int((len(each_frame_list)

ERROR: Unable to parse file: /code/stagesepx/hook.py
ERROR: Parse error at line 75 column 12:

   70:     def __init__(
   71:         self,
   72:         compress_rate: float = None,
   73:         target_size: typing.Tuple[int, int] = None,
   74:         *_,
  -->          **__,
   76:     ):
   77:         super().__init__(*_, **__)
   78:         self.compress_rate = compress_rate
   79:         self.target_size = target_size
   80: 

ERROR: Unable to parse file: /code/stagesepx/api.py
ERROR: Parse error at line 31 column 12:

   19: VideoObject
   20: 
   21: 
   22: def run(config: typing.Union[dict, str]):
   23:     """
   24:     run with config
   25: 
   26:     :param config: config file path, or a preload dict
   27:     :return:
   28:     """
   29: 
   30:     class _VideoUserConfig(BaseModel):
  -->          path: str
   32:         pre_load: bool = True
   33:         fps: int = None
   34: 
   35:     class _CutterUserConfig(BaseModel):
   36:         threshold: float = None
   37: 

ERROR: Unable to parse file: /code/stagesepx/video.py
ERROR: Parse error at line 19 column 21:

   17: object):
   18:     def __init__(self, frame_id: int, timestamp: float, data: np.ndarray):
  -->          self.frame_id: int = frame_id
   20:         self.timestamp: float = timestamp
   21:         self.data: np.ndarray = data
   22: 
   23:     def __str__(self):

ERROR: Unable to parse file: /code/stagesepx/reporter.py
ERROR: Parse error at line 34 column 16:

   24: .CHARSET) as t:
   25:         template = t.read()
   26:     return template
   27: 
   28: 
   29: class Reporter(object):
   30: 
   31: 
   32: 
   33: 
  -->      LABEL_STABLE: str = "stable"
   35:     LABEL_UNSTABLE: str = "unstable"
   36: 
   37:     LABEL_UNSPECIFIC: str = "unspecific"
   38: 
   39:     def __init__(self):
   40:         self.thumbnail_list: typing

ERROR: Unable to parse file: /code/stagesepx/toolbox.py
ERROR: Parse error at line 219 column 8:

  215: target_size: typing.Tuple[int, int] = None,
  216:     not_grey: bool = None,
  217:     interpolation: int = None,
  218:     *_,
  -->      **__,
  220: ) -> np.ndarray:
  221:     """
  222:     Compress frame
  223: 
  224:     :param old:
  225:         origin frame
  226: 
  227:     :param compress_rate:
  228:         before_pic * compress_rate = after_pic. default to 1 (no compression)
  229:         eg: 0.2 means 1/5 size of before_pic
  230: 
  231:     :param target_size:
  232:         tuple. (100, 200) means compressing before_pic to 100x200
  233: 
  234:     :param not_grey:
  235:         convert into grey if True
  236: 
  237:     :param interpolation:
  238:     :return:
  239:     """
  240: 
  241:     target = turn_grey(old) if not not_grey else old
  242: 
  243:     if not interpolation:
  244:         

ERROR: Unable to parse file: /code/stagesepx/classifier/svm.py
ERROR: Parse error at line 44 column 25:

   40: not feature_type:
   41:             feature_type = "hog"
   42:         if feature_type not in self.FEATURE_DICT:
   43:             raise AttributeError(f"no feature func named {feature_type}")
  -->          self.feature_func: typing.Callable = self.FEATURE_DICT[feature_type]
   45:         logger.debug(f"feature function: {feature_type}")
   46: 
   47: 
   48:         self._model: typing.Optional[LinearSVC] =

ERROR: Unable to parse file: /code/stagesepx/classifier/base.py
ERROR: Parse error at line 28 column 23:

   22: : str,
   23:         frame_id: int,
   24:         timestamp: float,
   25:         stage: str,
   26:         data: np.ndarray = None,
   27:     ):
  -->          self.video_path: str = video_path
   29:         self.frame_id: int = frame_id
   30:         self.timestamp: float = timestamp
   31:         self.stage: str = stage
   32: 
   33: 
   34:         self

ERROR: Unable to parse file: /code/stagesepx/classifier/keras.py
ERROR: Parse error at line 45 column 12:

   39: ,
   40:         nb_train_samples: int = None,
   41:         nb_validation_samples: int = None,
   42:         epochs: int = None,
   43:         batch_size: int = None,
   44:         *_,
  -->          **__,
   46:     ):
   47:         super(KerasClassifier, self).__init__(*_, **__)
   48: 
   49: 
   50:         self._model: typing.Optional[Sequential

ERROR: Unable to parse file: /code/stagesepx/cutter/cut_result.py
ERROR: Parse error at line 171 column 18:

  161: [],
  162:             )
  163: 
  164: 
  165: 
  166:         first_stable_range_end_id = unstable_range_list[0].start - 1
  167: 
  168:         end_stable_range_start_id = unstable_range_list[-1].end + 1
  169: 
  170: 
  -->          range_list: typing.List[VideoCutRange] = list()
  172: 
  173:         if first_stable_range_end_id >= 1:
  174:             logger.debug(f"stable start")
  175:             range_list.append(

ERROR: Unable to parse file: /code/stagesepx/cutter/cutter.py
ERROR: Parse error at line 37 column 23:

   27: 1
   28: 
   29: 
   30:         if (not compress_rate) and (not target_size):
   31:             logger.debug(
   32:                 f"no compress rate or target size received. set compress rate to 0.2"
   33:             )
   34:             compress_rate = 0.2
   35: 
   36: 
  -->          self._hook_list: typing.List[BaseHook] = list()
   38:         compress_hook = CompressHook(
   39:             overwrite=True, compress_rate=compress_rate, target_size=target_size
   40:         )
   41:         grey_hook

ERROR: Unable to parse file: /code/stagesepx/cutter/cut_range.py
ERROR: Parse error at line 160 column 16:

  153: .data) > threshold
  154: 
  155:     def diff(
  156:         self,
  157:         another: "VideoCutRange",
  158:         pre_hooks: typing.List[BaseHook],
  159:         *args,
  -->          **kwargs,
  161:     ) -> typing.List[float]:
  162:         self_picked = self.pick_and_get(*args, **kwargs)
  163:         another_picked = another.

INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 0.454s
INFO: Final Memory: 6M/295M
INFO: ------------------------------------------------------------------------