This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from contextlib import asynccontextmanager, contextmanager | |
| from typing import Generator | |
| from sqlalchemy import create_engine | |
| from sqlalchemy.ext.asyncio import async_sessionmaker, AsyncEngine, AsyncSession, create_async_engine | |
| from scada.core.config import settings | |
| @contextmanager |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _APP_ENV=production | |
| _APP_ENV=development | |
| _APP_SYSTEM_EMAIL_NAME=Appwrite | |
| [email protected] | |
| [email protected] | |
| _APP_OPTIONS_ABUSE=disabled | |
| _APP_OPTIONS_FORCE_HTTPS=disabled | |
| _APP_OPENSSL_KEY_V1=your-secret-key | |
| _APP_DOMAIN=demo.appwrite.io | |
| _APP_DOMAIN_TARGET=demo.appwrite.io |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from setuptools import setup | |
| setup( | |
| name='resize', | |
| version='0.0.1', | |
| py_modules=['resize'], | |
| install_requires=[ | |
| 'click', | |
| 'pillow', | |
| ], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ resize.py | |
| """ | |
| from __future__ import annotations | |
| import os | |
| import glob | |
| from pathlib import Path | |
| import sys | |
| import click |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resized = resize("checkers.jpg", 30.5) | |
| print(resized.size) | |
| resized.show("resized image", resized) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resized = resize("checkers.jpg", 30.5) | |
| print(resized.size) | |
| resized.show("resized image", resized) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resized = resize("checkers.jpg", 50) | |
| print(resized.shape) | |
| plt.imshow(resized) # can use cv2.imshow("name", image) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cv2 | |
| def resize(fp: str, scale: Union[float, int]) -> np.ndarray: | |
| """ Resize an image maintaining its proportions | |
| Args: | |
| fp (str): Path argument to image file | |
| scale (Union[float, int]): Percent as whole number of original image. eg. 53 | |
| Returns: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ resize.py | |
| """ | |
| from __future__ import annotations | |
| import os | |
| import glob | |
| from pathlib import Path | |
| import sys | |
| import click |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from PIL import Image | |
| def resize(fp: str, scale: Union[float, int]) -> np.ndarray: | |
| """ Resize an image maintaining its proportions | |
| Args: | |
| fp (str): Path argument to image file | |
| scale (Union[float, int]): Percent as whole number of original image. eg. 53 | |
| Returns: |
NewerOlder