In local machine, I am able to extract the feature of images and store the corresponding .npy file in a different folder.
from PIL import Image
from feature_extractor import FeatureExtractor
from pathlib import Path
import numpy as np
if __name__ == '__main__':
fe = FeatureExtractor()
for img_path in sorted(Path("./static/img").glob("*.jpg")):
print(img_path) # e.g., ./static/img/xxx.jpg
feature = fe.extract(img=Image.open(img_path))
feature_path = Path("./static/feature") / (img_path.stem + ".npy") # e.g., ./static/feature/xyz.npy
np.save(feature_path, feature)
Now I want to host this in google cloud. But for this I need to read and write the images from Google Cloud Storage. Is there any library like Path for GCS ?