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
标签云
GIT Ptyhon Crawler Agent Bin Proxy Nginx uwsgi 证件照 LLAMA Miniforge 递归学习法 Heatmap PIP Google 多线程 Gemma Food Michelin GGML Sklearn Git LoRA PDB FP8 Mixtral COCO Llama NLP RAR Vim JSON GoogLeNet Shortcut Color mmap Pandas Pillow Pytorch LeetCode logger AI UNIX UI Transformers HuggingFace NLTK Tiktoken Datetime RGB Paddle Hilton Image2Text SQLite git-lfs Bipartite Rebuttal uWSGI News CAM Statistics FP32 Firewall Plate 签证 XML Hotel Clash 云服务器 CLAP SVR Bert Paper Anaconda ONNX Quantize OpenAI YOLO 净利润 Excel 图标 printf VGG-16 Qwen2 Claude GPTQ Magnet Domain WAN VSCode 论文 torchinfo Interview FastAPI Jupyter 报税 PyCharm Password git FlashAttention Baidu LLM Card tqdm PyTorch MD5 Safetensors API XGBoost tar Data BeautifulSoup Web 多进程 Django CEIR Conda 论文速读 第一性原理 搞笑 Website C++ Input SQL CV ChatGPT Math ResNet-50 FP64 Review Tracking CTC Bitcoin IndexTTS2 Hungarian Numpy Docker EXCEL Translation Qwen Animate Pickle BF16 OCR Video Breakpoint Linux Streamlit Template Plotly TTS OpenCV Python v0.dev SPIE Knowledge Search 财报 SAM scipy Logo Quantization VPN 阿里云 公式 WebCrawler HaggingFace TensorRT Algorithm Markdown Qwen2.5 关于博主 Random Freesound Ubuntu LaTeX 算法题 Distillation llama.cpp 继承 CC QWEN 顶会 icon 强化学习 transformers RL 飞书 DeepStream Dataset Vmess Jetson CUDA NameSilo Diagram Github TSV 音频 FP16 域名 diffusers BTC Zip hf Cloudreve Attention 版权 腾讯云 DeepSeek ModelScope TensorFlow CSV Base64 Use 图形思考法 Disk Windows PDF Augmentation ms-swift Tensor Permission v2ray GPT4 Land InvalidArgumentError
站点统计

本站现有博文333篇,共被浏览922533

本站已经建立2628天!

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