EADST

Python: Resize the Image Size

Resize the image size with Python OpenCV.

import cv2

path = 'test.jpg'
img = cv2.imread(path, 1)
img_size = img.shape
height = img_size[0]
width = img_size[1]
resize_height = int(height * 0.5)
resize_width = int(width * 0.5)
new_image = cv2.resize(img, (resize_width, resize_height))
resize_file = 'resize_' + path
cv2.imwrite(resize_file, new_image)
相关标签
About Me
XD
Goals determine what you are going to be.
Category
标签云
Docker 音频 v2ray Tensor NLTK Paddle Magnet GGML 公式 Quantization XGBoost Image2Text COCO AI CTC InvalidArgumentError Transformers 阿里云 版权 Disk Use 关于博主 FP32 tqdm Excel Math hf 签证 Bert Pytorch git Jetson mmap Land Review VSCode FP64 Diagram WebCrawler Python Google Attention Paper uwsgi OpenAI Hungarian Video ChatGPT PyCharm Quantize DeepSeek ResNet-50 Freesound Jupyter NameSilo TensorRT UI LLAMA 多线程 PDB Qwen2.5 Streamlit Plotly llama.cpp CSV Mixtral MD5 TensorFlow Linux Qwen2 Proxy uWSGI CV OCR 证件照 XML Numpy Zip Bitcoin Vim scipy TTS 多进程 EXCEL DeepStream diffusers JSON Template Breakpoint BTC Tracking logger 净利润 v0.dev Clash Data Ubuntu SPIE 算法题 Hotel QWEN Password Shortcut Food 搞笑 BF16 printf TSV Permission Web Base64 Pandas Domain API Nginx CEIR 报税 Random FastAPI Statistics Crawler Translation CC Pillow FlashAttention CAM Gemma tar PyTorch Knowledge transformers Sklearn SQL Django HuggingFace Augmentation LoRA Distillation Safetensors GoogLeNet Animate NLP Michelin PDF FP8 VGG-16 YOLO Ptyhon VPN SAM Claude Anaconda Conda Github Datetime FP16 Miniforge Windows Markdown ONNX torchinfo Interview HaggingFace Hilton 继承 腾讯云 飞书 OpenCV CLAP GPT4 Algorithm Llama Logo Cloudreve Card LLM 域名 RGB Pickle Bipartite Plate GIT BeautifulSoup Bin Heatmap Vmess Firewall git-lfs Baidu IndexTTS2 SVR Qwen LaTeX ModelScope LeetCode Tiktoken RAR WAN PIP Git Input Dataset CUDA C++ GPTQ UNIX SQLite Color 财报 Website
站点统计

本站现有博文309篇,共被浏览735796

本站已经建立2372天!

热门文章
文章归档
回到顶部