plot image
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import os
|
||||
from datetime import datetime
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
import cv2 as cv
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
@@ -9,7 +11,6 @@ from PIL import Image
|
||||
|
||||
PHOTOS_PATH = "./photos/"
|
||||
|
||||
|
||||
# Get a list of images given a directory path
|
||||
def get_images(url: str):
|
||||
images = []
|
||||
@@ -126,6 +127,13 @@ def preview_image(img: np.ndarray):
|
||||
cv.waitKey(0)
|
||||
cv.destroyAllWindows()
|
||||
|
||||
def plot_image(img, figsize=(6,6)):
|
||||
fig, ax = plt.subplots(figsize=figsize)
|
||||
ax.imshow(img)
|
||||
ax.axis("off")
|
||||
|
||||
return fig
|
||||
|
||||
|
||||
def __main__():
|
||||
imgs = get_images(PHOTOS_PATH)
|
||||
@@ -157,7 +165,4 @@ def __main__():
|
||||
print("success_len: ", len(success))
|
||||
print("fail_len: ", len(fail))
|
||||
|
||||
return None
|
||||
|
||||
|
||||
__main__()
|
||||
return None
|
||||
Reference in New Issue
Block a user