Skip to content

Commit

Permalink
Denoised and contrast amplified variants
Browse files Browse the repository at this point in the history
  • Loading branch information
liebharc committed Jun 13, 2024
1 parent 94d337b commit acef9e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion homr/staff_parsing_tromr.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ def apply_clahe(staff_image: NDArray, clip_limit: float = 2.0, kernel_size: int


def build_image_options(staff_image: NDArray) -> list[NDArray]:
return [staff_image]
denoised1 = cv2.fastNlMeansDenoisingColored(staff_image, None, 10, 10, 7, 21)
return [
staff_image,
denoised1,
apply_clahe(denoised1),
]


def predict_best(
Expand Down
2 changes: 1 addition & 1 deletion homr/transformer/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def generate( # noqa: PLR0915
if is_eos == 0:
break
retry = merger.add_symbol(rhythm_token[0][0], pitch_token[0][0], lift_token[0][0])
current_temperature *= 2
current_temperature *= 3.5
attempt += 1

out_lift = torch.cat((out_lift, lift_sample), dim=-1)
Expand Down

0 comments on commit acef9e2

Please sign in to comment.