python: 压缩图片
pip install imageio
image = imageio.imread("1.jpg")
imageio.imwrite("output_image.webp", image, "WEBP")
# 代码示例:使用Python的Keras库构建Autoencoder模型 from keras.models import Model from keras.layers import Input, Dense input_img = Input(shape=(784,)) encoded = Dense(128, activation='relu')(input_img) decoded = Dense(784, activation='sigmoid')(encoded) autoencoder = Model(input_img, decoded) autoencoder.compile(optimizer='adam', loss='binary_crossentropy')
rows, cols = (10, 10)
F = [[0] * cols] * rows
print(F)
n=3
y=0
while y<10:
x=0
while x<10:
for i in range(y,y+n-1):
for j in range(x,x+n-1):
if(i<=9 and j<=9):
F[i][j]=1
x=x+(n*2)
y=y+(n*2)
print(F)
哲学管理(学)人生, 文学艺术生活, 自动(计算机学)物理(学)工作, 生物(学)化学逆境, 历史(学)测绘(学)时间, 经济(学)数学金钱(理财), 心理(学)医学情绪, 诗词美容情感, 美学建筑(学)家园, 解构建构(分析)整合学习, 智商情商(IQ、EQ)运筹(学)生存.---Geovin Du(涂聚文)