圖片縮?。?>怎么能讓這個圖縮?。ㄔ趺纯梢宰?a target="_blank" href="http://m.bai1xia.com/news/tags-139.html"style="font-weight:bold;">圖片縮?。?/a>
767
2022-05-30
環(huán)境信息
ModelArts
Notebook - pytorch1.4-cuda10.1-cudnn7-ubuntu18.04
JupyterLab - Notebook - Conda-python3
OpenCV 讀取圖片
import cv2 --------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last)
!pip install opencv-python Looking in indexes: http://repo.myhuaweicloud.com/repository/pypi/simple Collecting opencv-python Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/6b/73/a8921d221a673600dc744033786eeab56ed5116686a1b932b724a33003c6/opencv_python-4.5.3.56-cp37-cp37m-manylinux2014_x86_64.whl (49.9 MB) |████████████████████████████████| 49.9 MB 54.2 MB/s eta 0:00:01 | 7.1 MB 54.2 MB/s eta 0:00:01 | 9.7 MB 54.2 MB/s eta 0:00:01 | 11.8 MB 54.2 MB/s eta 0:00:01 | 15.5 MB 54.2 MB/s eta 0:00:014.2 MB/s eta 0:00:01 | 25.8 MB 54.2 MB/s eta 0:00:01 | 31.1 MB 54.2 MB/s eta 0:00:01??█████▏ | 37.6 MB 54.2 MB/s eta 0:00:01??███████████████████▎ | 44.2 MB 54.2 MB/s eta 0:00:01 Requirement already satisfied: numpy>=1.14.5 in /home/ma-user/modelarts-sdk (from opencv-python) (1.21.0) Installing collected packages: opencv-python Successfully installed opencv-python-4.5.3.56
import cv2 img = cv2.imread("1.png") img array([[[255, 255, 255], [255, 255, 255], [255, 255, 255], ..., [255, 255, 255], [255, 255, 255], [255, 255, 255]], [[255, 255, 255], [255, 255, 255], [255, 255, 255], ..., [255, 255, 255], [255, 255, 255], [255, 255, 255]], [[255, 255, 255], [255, 255, 255], [255, 255, 255], ..., [255, 255, 255], [255, 255, 255], [255, 255, 255]], ..., [[255, 255, 255], [255, 255, 255], [255, 255, 255], ..., [255, 255, 255], [255, 255, 255], [255, 255, 255]], [[255, 255, 255], [255, 255, 255], [255, 255, 255], ..., [255, 255, 255], [255, 255, 255], [255, 255, 255]], [[255, 255, 255], [255, 255, 255], [255, 255, 255], ..., [255, 255, 255], [255, 255, 255], [255, 255, 255]]], dtype=uint8)
help
help(cv2.imread) Help on built-in function imread: imread(...) imread(filename[, flags]) -> retval . @brief Loads an image from a file. . . @anchor imread . . The function imread loads an image from the specified file and returns it. If the image cannot be . read (because of missing file, improper permissions, unsupported or invalid format), the function . returns an empty matrix ( Mat::data==NULL ). . . Currently, the following file formats are supported: . . - Windows bitmaps - \*.bmp, \*.dib (always supported) . - JPEG files - \*.jpeg, \*.jpg, \*.jpe (see the *Note* section) . - JPEG 2000 files - \*.jp2 (see the *Note* section) . - Portable Network Graphics - \*.png (see the *Note* section) . - WebP - \*.webp (see the *Note* section) . - Portable image format - \*.pbm, \*.pgm, \*.ppm \*.pxm, \*.pnm (always supported) . - PFM files - \*.pfm (see the *Note* section) . - Sun rasters - \*.sr, \*.ras (always supported) . - TIFF files - \*.tiff, \*.tif (see the *Note* section) . - OpenEXR Image files - \*.exr (see the *Note* section) . - Radiance HDR - \*.hdr, \*.pic (always supported) . - Raster and Vector geospatial data supported by GDAL (see the *Note* section) ......
相關(guān)鏈接
Python入門篇
Python進階篇
Python應(yīng)用篇
幫助文檔-AI開發(fā)平臺ModelArts
【生長吧!Python】有獎?wù)魑幕馃徇M行中
備注
歡迎各位同學一起來交流學習心得^_^
在線課程、沙箱實驗、認證、論壇和直播,其中包含了許多優(yōu)質(zhì)的內(nèi)容,推薦了解與學習。
AI開發(fā)平臺ModelArts OpenCV Python
版權(quán)聲明:本文內(nèi)容由網(wǎng)絡(luò)用戶投稿,版權(quán)歸原作者所有,本站不擁有其著作權(quán),亦不承擔相應(yīng)法律責任。如果您發(fā)現(xiàn)本站中有涉嫌抄襲或描述失實的內(nèi)容,請聯(lián)系我們jiasou666@gmail.com 處理,核實后本網(wǎng)站將在24小時內(nèi)刪除侵權(quán)內(nèi)容。