Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
EhsanKia committed Dec 6, 2021
1 parent 9e2920e commit 37831d3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ def _parse_frame(frame: numpy.ndarray, for_sale: bool) -> Iterator[numpy.ndarray
# Last line has dashes after but first line doesn't have dashes before,
# therefore we prepend the list with zero for the starting line.
y_lines = list((frame[:, 0] < 200).nonzero()[0])
if not y_lines:
return

# Normalize row lines by taking the average of all of them.
# We know they are 53.45px apart, so we find the best offset from given lines.
Expand Down
2 changes: 1 addition & 1 deletion scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def scan_media(filename: str, mode: str = 'auto', locale: str = 'auto', for_sale
if mode not in SCANNERS:
raise RuntimeError('Invalid mode: %r' % mode)

assert mode != 'storage', 'Storage scanning is not yet supported.'
assert mode != 'storage', 'Storage scanning is not supported.'

kwargs = {}
if mode == 'catalog':
Expand Down
2 changes: 1 addition & 1 deletion storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def _is_duplicate_row(all_rows: List[numpy.ndarray], new_row: List[numpy.ndarray
return False

new_concat = cv2.hconcat(new_row)
# Checks the last 3 rows for similarities to the newly added row.
# Checks the last 4 rows for similarities to the newly added row.
for ind in [slice(-8, None), slice(-16, -8), slice(-24, -16), slice(-32, -24)]:
old_concat = cv2.hconcat(all_rows[ind])
if old_concat is None:
Expand Down

0 comments on commit 37831d3

Please sign in to comment.