Skip to content

Commit

Permalink
Use better file handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sohn123 committed Dec 15, 2024
1 parent 82367e2 commit a0a039c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions visualize.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#!/bin/env python3
import argparse
import matplotlib.pyplot as plt
import numpy as np


def main(input_file: str, output_file: str | None):
image = []
with open(input_file) as f:
for line in f:
image.append([int(i) for i in line.split(",")])
image = np.loadtxt(input_file, delimiter=",", dtype=np.uint16)

plt.imshow(image, interpolation="none")

Expand Down

0 comments on commit a0a039c

Please sign in to comment.