最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

基于Python實(shí)現(xiàn)高效PPT轉(zhuǎn)圖片工具

 更新時(shí)間:2025年04月10日 14:57:47   作者:探客白澤  
在日常工作中,PPT是我們常用的演示工具,但有時(shí)候我們需要將PPT的內(nèi)容提取為圖片格式以便于展示或保存,所以本文將用Python實(shí)現(xiàn)PPT轉(zhuǎn)PNG工具,希望對大家有所幫助

在日常工作中,PPT(PowerPoint)文件是我們常用的演示工具。然而,有時(shí)候我們需要將PPT的內(nèi)容提取為圖片格式(如PNG)以便于展示或保存。手動(dòng)將每一頁P(yáng)PT保存為圖片不僅繁瑣且容易出錯(cuò)。為了提高工作效率,我們可以通過編程自動(dòng)化這一過程。本篇文章將詳細(xì)介紹如何使用Python語言開發(fā)一款PPT轉(zhuǎn)PNG工具,基于Tkinter圖形界面和win32com庫,支持批量PPT轉(zhuǎn)圖片及圖像網(wǎng)格拼接功能。

1. 概述

本工具的目標(biāo)是將PPT文件的每一頁轉(zhuǎn)換為高質(zhì)量的PNG圖片,并提供一個(gè)圖形化界面,幫助用戶快速選擇PPT文件并完成轉(zhuǎn)換操作。該工具的實(shí)現(xiàn)基于以下幾個(gè)核心技術(shù):

  • Tkinter:Python標(biāo)準(zhǔn)庫中的GUI工具,用于構(gòu)建用戶界面。
  • win32com:通過調(diào)用PowerPoint的COM接口來操作PPT文件,實(shí)現(xiàn)文件轉(zhuǎn)換。
  • PIL(Pillow):Python Imaging Library,用于處理圖像,包括圖像的讀取、修改和保存。
  • psutil:用于檢查并確保PowerPoint進(jìn)程的安全退出,避免進(jìn)程殘留導(dǎo)致的錯(cuò)誤。

核心功能

  • PPT轉(zhuǎn)PNG:將PPT中的每一頁轉(zhuǎn)換為PNG格式的圖片。
  • 圖像網(wǎng)格拼接:將轉(zhuǎn)換后的PNG圖片按特定規(guī)則排列為一張大圖,盡量保證輸出圖像的比例接近4:3。
  • 圖形界面:提供簡潔直觀的用戶界面,支持文件選擇、轉(zhuǎn)換進(jìn)度顯示及轉(zhuǎn)換狀態(tài)提示。

2. 功能使用

2.1 安裝依賴

首先,需要安裝一些必要的Python庫。在命令行中運(yùn)行以下命令:

pip install pillow psutil pywin32

2.2 使用步驟

啟動(dòng)工具:運(yùn)行程序后,打開的GUI界面包含了文件選擇、進(jìn)度條以及狀態(tài)提示區(qū)域。

選擇PPT文件:點(diǎn)擊“瀏覽”按鈕選擇需要轉(zhuǎn)換的PPT文件。只支持.ppt和.pptx文件格式。

開始轉(zhuǎn)換:選擇文件后,點(diǎn)擊“開始轉(zhuǎn)換”按鈕,程序會(huì)自動(dòng)將PPT的每一頁轉(zhuǎn)換為PNG圖片并保存到臨時(shí)目錄中。

創(chuàng)建網(wǎng)格圖:轉(zhuǎn)換完成后,程序會(huì)根據(jù)指定的列數(shù)將所有圖片拼接為一張大圖。最終輸出圖像的比例盡量接近4:3。

查看結(jié)果:轉(zhuǎn)換完成后,程序會(huì)顯示輸出文件的保存路徑,并提供成功提示。

2.3 代碼實(shí)現(xiàn)

PPT轉(zhuǎn)換為PNG

PPT文件的轉(zhuǎn)換操作依賴于PowerPoint的COM接口。通過win32com.client.DispatchEx我們可以啟動(dòng)PowerPoint應(yīng)用,加載PPT文件并提取每一頁為PNG圖片。

def ppt_to_images(ppt_path, output_dir):
    """將PPT轉(zhuǎn)換為圖片"""
    if not os.path.exists(output_dir):
        os.makedirs(output_dir)
     
    ppt_path = os.path.abspath(ppt_path)
     
    try:
        for proc in psutil.process_iter(['name']):
            if proc.info['name'] and 'powerpnt' in proc.info['name'].lower():
                proc.kill()
    except:
        pass
     
    time.sleep(1)
     
    max_retries = 3
    retry_count = 0
    last_error = None
    powerpoint = None
     
    while retry_count < max_retries:
        try:
            powerpoint = win32com.client.DispatchEx("PowerPoint.Application")
            powerpoint.Visible = 1
            powerpoint.DisplayAlerts = 0
            presentation = powerpoint.Presentations.Open(ppt_path, WithWindow=False)
            total_slides = presentation.Slides.Count
            for i in range(1, total_slides + 1):
                image_path = os.path.join(output_dir, f'slide_{i:03d}.png')
                slide = presentation.Slides(i)
                slide.Export(image_path, "PNG", 1920, 1080)
                time.sleep(0.5)
            presentation.Close()
            return
        except Exception as e:
            retry_count += 1
            last_error = e
            if retry_count >= max_retries:
                raise Exception(f"PowerPoint轉(zhuǎn)換失敗,已重試{max_retries}次。錯(cuò)誤信息: {str(last_error)}")
            time.sleep(2)

圖像網(wǎng)格拼接

對于轉(zhuǎn)換后的每一張PNG圖片,程序?qū)L試按不同的列數(shù)排列,以獲得接近4:3的圖像比例。

def create_grid_image(image_dir, output_path, target_width=1920):
    """將圖片緊湊排列,并使最終圖片比例接近4:3"""
    image_files = sorted([f for f in os.listdir(image_dir) if f.endswith('.png')])
    if not image_files:
        raise Exception("沒有找到轉(zhuǎn)換后的圖片文件!")
    images = [Image.open(os.path.join(image_dir, img_file)) for img_file in image_files]

???????    best_cols = 1
    best_ratio_diff = float('inf')
    best_layout = None
     
    for num_cols in range(1, 6):
        layout, row_heights = [], []
        current_row, max_row_height = [], 0
         
        for img in images:
            scale = (target_width / num_cols) / img.width
            new_width = int(img.width * scale)
            new_height = int(img.height * scale)
            current_row.append((new_width, new_height))
            max_row_height = max(max_row_height, new_height)
             
            if len(current_row) == num_cols:
                layout.append(current_row)
                row_heights.append(max_row_height)
                current_row, max_row_height = [], 0
         
        if current_row:
            layout.append(current_row)
            row_heights.append(max_row_height)
         
        total_width = target_width
        total_height = sum(row_heights)
        target_ratio = 4/3
        actual_ratio = total_width / total_height
        ratio_diff = abs(target_ratio - actual_ratio)
         
        if ratio_diff < best_ratio_diff:
            best_ratio_diff = ratio_diff
            best_cols = num_cols
            best_layout = (layout, row_heights)
    
    layout, row_heights = best_layout
    canvas = Image.new('RGB', (target_width, sum(row_heights)), 'white')
    
    y = 0
    img_index = 0
    for row, row_height in zip(layout, row_heights):
        x = 0
        for width, height in row:
            if img_index < len(images):
                img = images[img_index].resize((width, height), Image.Resampling.LANCZOS)
                canvas.paste(img, (x, y))
                x += width
                img_index += 1
        y += row_height
    
    canvas.save(output_path, quality=95)

2.4 GUI界面

GUI使用Tkinter構(gòu)建,包含了文件選擇框、轉(zhuǎn)換進(jìn)度條、狀態(tài)標(biāo)簽和按鈕,確保用戶能夠直觀地使用該工具進(jìn)行PPT轉(zhuǎn)換。

class PPTConverterGUI:
    def __init__(self, root):
        self.root = root
        self.root.title("PPT轉(zhuǎn)JPG工具")
        self.root.geometry("600x400")
        ...
    
    def browse_file(self):
        file_path = filedialog.askopenfilename(filetypes=[("PowerPoint文件", "*.ppt;*.pptx")])
        if file_path:
            self.file_path.set(file_path)
            logging.info(f"選擇了文件: {file_path}")
    
    def start_conversion(self):
        ppt_path = self.file_path.get()
        ...
        thread = threading.Thread(target=self.convert_ppt, args=(ppt_path,))
        thread.start()

3.效果展示

生成jpg圖片效果圖:

4.相關(guān)源碼

import os
from PIL import Image
import tempfile
import win32com.client
import time
import math
import tkinter as tk
from tkinter import filedialog, ttk, messagebox
import threading
import traceback
import logging
import psutil

# 配置日志
logging.basicConfig(
    filename='ppt_converter.log',
    level=logging.DEBUG,
    format='%(asctime)s - %(levelname)s - %(message)s'
)

def ppt_to_images(ppt_path, output_dir):
    """將PPT轉(zhuǎn)換為圖片"""
    # 創(chuàng)建臨時(shí)目錄
    if not os.path.exists(output_dir):
        os.makedirs(output_dir)
     
    # 確保使用絕對路徑
    ppt_path = os.path.abspath(ppt_path)
     
    # 確保PowerPoint進(jìn)程已完全退出
    try:
        for proc in psutil.process_iter(['name']):
            if proc.info['name'] and 'powerpnt' in proc.info['name'].lower():
                proc.kill()
    except:
        pass
     
    time.sleep(1)  # 等待進(jìn)程完全退出
     
    max_retries = 3
    retry_count = 0
    last_error = None
    powerpoint = None
     
    while retry_count < max_retries:
        try:
            # 使用PowerPoint COM對象
            powerpoint = win32com.client.DispatchEx("PowerPoint.Application")
           
             
            try:
                # 設(shè)置PowerPoint為可見(有些系統(tǒng)必須設(shè)置為可見才能工作)
                powerpoint.Visible = 1
                powerpoint.DisplayAlerts = 0
                 
                # 打開演示文稿
                presentation = powerpoint.Presentations.Open(
                    ppt_path,
                    WithWindow=False  # 嘗試不顯示窗口
                )
                 
                # 遍歷每一頁并保存為圖片
                total_slides = presentation.Slides.Count
                for i in range(1, total_slides + 1):
                    image_path = os.path.join(output_dir, f'slide_{i:03d}.png')
                    slide = presentation.Slides(i)
                    slide.Export(image_path, "PNG", 1920, 1080)  # 指定分辨率
                    time.sleep(0.5)  # 給PowerPoint一些時(shí)間來處理
                 
                # 正常關(guān)閉
                presentation.Close()
                return  # 成功完成,退出函數(shù)
                 
            finally:
                # 確保清理資源
                if powerpoint:
                    try:
                        powerpoint.Quit()
                    except:
                        pass
                    finally:
                        powerpoint = None
                 
        except Exception as e:
            retry_count += 1
            last_error = e
             
            # 確保PowerPoint被關(guān)閉
            if powerpoint:
                try:
                    powerpoint.Quit()
                except:
                    pass
                finally:
                    powerpoint = None
             
            if retry_count >= max_retries:
                error_msg = f"PowerPoint轉(zhuǎn)換失敗,已重試{max_retries}次。錯(cuò)誤信息: {str(last_error)}"
                logging.error(error_msg)
                raise Exception(error_msg)
             
            logging.info(f"第{retry_count}次嘗試失敗,等待后重試...")
            time.sleep(2)  # 等待一段時(shí)間后重試
     
    raise Exception("PowerPoint轉(zhuǎn)換失敗,超過最大重試次數(shù)")

def create_grid_image(image_dir, output_path, target_width=1920):
    """將圖片緊湊排列,并使最終圖片比例接近4:3"""
    # 獲取所有圖片文件
    image_files = sorted([f for f in os.listdir(image_dir) if f.endswith('.png')])
     
    if not image_files:
        raise Exception("沒有找到轉(zhuǎn)換后的圖片文件!")
     
    # 讀取所有圖片
    images = []
    for img_file in image_files:
        img = Image.open(os.path.join(image_dir, img_file))
        images.append(img)

    # 找到最佳的列數(shù),使最終圖片比例最接近4:3
    best_cols = 1
    best_ratio_diff = float('inf')
    best_layout = None
     
    # 嘗試不同的列數(shù)(1到5列)
    for num_cols in range(1, 6):
        # 計(jì)算這個(gè)列數(shù)下的布局
        layout = []
        current_row = []
        row_heights = []
        max_row_height = 0
         
        for img in images:
            # 計(jì)算縮放后的尺寸
            scale = (target_width / num_cols) / img.width
            new_width = int(img.width * scale)
            new_height = int(img.height * scale)
             
            current_row.append((new_width, new_height))
            max_row_height = max(max_row_height, new_height)
             
            if len(current_row) == num_cols:
                layout.append(current_row)
                row_heights.append(max_row_height)
                current_row = []
                max_row_height = 0
         
        # 處理最后一行
        if current_row:
            layout.append(current_row)
            row_heights.append(max_row_height)
         
        # 計(jì)算總寬度和高度
        total_width = target_width
        total_height = sum(row_heights)
         
        # 計(jì)算與4:3比例的差異
        target_ratio = 4/3
        actual_ratio = total_width / total_height
        ratio_diff = abs(target_ratio - actual_ratio)
         
        # 更新最佳列數(shù)
        if ratio_diff < best_ratio_diff:
            best_ratio_diff = ratio_diff
            best_cols = num_cols
            best_layout = (layout, row_heights)
     
    # 使用最佳列數(shù)創(chuàng)建最終圖片
    layout, row_heights = best_layout
    canvas_width = target_width
    canvas_height = sum(row_heights)
    canvas = Image.new('RGB', (canvas_width, canvas_height), 'white')
     
    # 拼接圖片
    y = 0
    img_index = 0
    for row, row_height in zip(layout, row_heights):
        x = 0
        for width, height in row:
            if img_index < len(images):
                img = images[img_index]
                img = img.resize((width, height), Image.Resampling.LANCZOS)
                canvas.paste(img, (x, y))
                x += width
                img_index += 1
        y += row_height
     
    # 裁剪掉多余的空白部分
    bbox = canvas.getbbox()
    if bbox:
        canvas = canvas.crop(bbox)
     
    # 保存最終圖片
    canvas.save(output_path, quality=95)

class PPTConverterGUI:
    def __init__(self, root):
        self.root = root
        self.root.title("PPT轉(zhuǎn)JPG工具")
        self.root.geometry("600x400")
         
        # 設(shè)置主題樣式
        style = ttk.Style()
        style.configure("TButton", padding=6, relief="flat", background="#2196F3")
        style.configure("TLabel", padding=6, font=('微軟雅黑', 10))
         
        # 創(chuàng)建主框架
        main_frame = ttk.Frame(root, padding="20")
        main_frame.grid(row=0, column=0, sticky=(tk.W, tk.E, tk.N, tk.S))
         
        # 標(biāo)題
        title_label = ttk.Label(main_frame, text="PPT轉(zhuǎn)JPG工具", font=('微軟雅黑', 16, 'bold'))
        title_label.grid(row=0, column=0, columnspan=2, pady=20)
         
        # 文件選擇區(qū)域
        file_frame = ttk.LabelFrame(main_frame, text="選擇PPT文件", padding="10")
        file_frame.grid(row=1, column=0, columnspan=2, sticky=(tk.W, tk.E), pady=10)
         
        self.file_path = tk.StringVar()
        self.file_entry = ttk.Entry(file_frame, textvariable=self.file_path, width=50)
        self.file_entry.grid(row=0, column=0, padx=5)
         
        browse_button = ttk.Button(file_frame, text="瀏覽", command=self.browse_file)
        browse_button.grid(row=0, column=1, padx=5)
         
        # 轉(zhuǎn)換按鈕
        self.convert_button = ttk.Button(main_frame, text="開始轉(zhuǎn)換", command=self.start_conversion)
        self.convert_button.grid(row=2, column=0, columnspan=2, pady=20)
         
        # 進(jìn)度條
        self.progress = ttk.Progressbar(main_frame, length=400, mode='indeterminate')
        self.progress.grid(row=3, column=0, columnspan=2, pady=10)
         
        # 狀態(tài)標(biāo)簽
        self.status_label = ttk.Label(main_frame, text="")
        self.status_label.grid(row=4, column=0, columnspan=2, pady=10)
         
        # 配置網(wǎng)格權(quán)重
        main_frame.columnconfigure(0, weight=1)
        main_frame.columnconfigure(1, weight=1)
         
    def browse_file(self):
        file_path = filedialog.askopenfilename(
            filetypes=[("PowerPoint文件", "*.ppt;*.pptx")]
        )
        if file_path:
            self.file_path.set(file_path)
            logging.info(f"選擇了文件: {file_path}")
             
    def start_conversion(self):
        ppt_path = self.file_path.get()
        if not ppt_path:
            messagebox.showerror("錯(cuò)誤", "請先選擇PPT文件!")
            return
             
        if not os.path.exists(ppt_path):
            messagebox.showerror("錯(cuò)誤", "文件不存在!")
            return
             
        # 禁用按鈕并顯示進(jìn)度條
        self.convert_button.state(['disabled'])
        self.progress.start()
        self.status_label.config(text="正在轉(zhuǎn)換中...")
         
        # 在新線程中執(zhí)行轉(zhuǎn)換
        thread = threading.Thread(target=self.convert_ppt, args=(ppt_path,))
        thread.start()
         
    def convert_ppt(self, ppt_path):
        temp_dir = None
        try:
            logging.info(f"開始轉(zhuǎn)換PPT文件: {ppt_path}")
             
            # 創(chuàng)建臨時(shí)目錄
            temp_dir = tempfile.mkdtemp()
            logging.info(f"創(chuàng)建臨時(shí)目錄: {temp_dir}")
             
            output_path = os.path.join(os.path.dirname(ppt_path), "output_grid_image.png")
            logging.info(f"輸出路徑: {output_path}")
             
            # 轉(zhuǎn)換PPT為圖片
            logging.info("開始轉(zhuǎn)換PPT為圖片...")
            ppt_to_images(ppt_path, temp_dir)
            logging.info("PPT轉(zhuǎn)圖片完成")
             
            # 創(chuàng)建網(wǎng)格圖
            logging.info("開始創(chuàng)建網(wǎng)格圖...")
            create_grid_image(temp_dir, output_path)
            logging.info("網(wǎng)格圖創(chuàng)建完成")
             
            # 清理臨時(shí)文件
            logging.info("清理臨時(shí)文件...")
            for file in os.listdir(temp_dir):
                os.remove(os.path.join(temp_dir, file))
            os.rmdir(temp_dir)
            logging.info("臨時(shí)文件清理完成")
             
            # 更新UI
            self.root.after(0, self.conversion_complete, output_path)
             
        except Exception as e:
            error_msg = f"轉(zhuǎn)換失敗: {str(e)}\n{traceback.format_exc()}"
            logging.error(error_msg)
            self.root.after(0, self.conversion_error, error_msg)
        finally:
            # 確保清理臨時(shí)文件
            if temp_dir and os.path.exists(temp_dir):
                try:
                    for file in os.listdir(temp_dir):
                        os.remove(os.path.join(temp_dir, file))
                    os.rmdir(temp_dir)
                except Exception as e:
                    logging.error(f"清理臨時(shí)文件失敗: {str(e)}")
             
    def conversion_complete(self, output_path):
        self.progress.stop()
        self.convert_button.state(['!disabled'])
        self.status_label.config(text=f"轉(zhuǎn)換完成!輸出文件保存在: {output_path}")
        messagebox.showinfo("成功", "PPT轉(zhuǎn)換完成!")
         
    def conversion_error(self, error_msg):
        self.progress.stop()
        self.convert_button.state(['!disabled'])
        self.status_label.config(text="轉(zhuǎn)換失??!")
        messagebox.showerror("錯(cuò)誤", f"轉(zhuǎn)換過程中出現(xiàn)錯(cuò)誤: {error_msg}")

def main():
    root = tk.Tk()
    app = PPTConverterGUI(root)
    root.mainloop()

if __name__ == "__main__":
    main()

5. 總結(jié)

通過本篇文章,您已經(jīng)了解了如何使用Python編寫一款PPT轉(zhuǎn)圖片的工具。我們通過Tkinter構(gòu)建了一個(gè)簡潔的GUI界面,通過win32com調(diào)用PowerPoint的COM接口進(jìn)行文件轉(zhuǎn)換,并通過Pillow處理圖像拼接。無論是用于日常的文件轉(zhuǎn)換,還是處理多個(gè)PPT文件,本工具都能大大提高工作效率。

此工具的擴(kuò)展性也很強(qiáng),您可以根據(jù)需要進(jìn)一步優(yōu)化圖像的處理過程,或者增加更多的自定義功能,例如支持更多格式的轉(zhuǎn)換,添加批量處理功能等。希望本教程能幫助您更好地實(shí)現(xiàn)PPT轉(zhuǎn)圖片的自動(dòng)化,提升工作效率。

以上就是基于Python實(shí)現(xiàn)高效PPT轉(zhuǎn)圖片工具的詳細(xì)內(nèi)容,更多關(guān)于Python PPT轉(zhuǎn)圖片的資料請關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

  • Python實(shí)現(xiàn)病毒仿真器的方法示例(附demo)

    Python實(shí)現(xiàn)病毒仿真器的方法示例(附demo)

    這篇文章主要介紹了Python實(shí)現(xiàn)病毒仿真器的方法示例,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-02-02
  • python numpy 反轉(zhuǎn) reverse示例

    python numpy 反轉(zhuǎn) reverse示例

    今天小編就為大家分享一篇python numpy 反轉(zhuǎn) reverse示例,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2019-12-12
  • pip install安裝報(bào)錯(cuò)Backend ‘setuptools.build_meta’不可用的問題解決指南

    pip install安裝報(bào)錯(cuò)Backend ‘setuptools.build_meta’不可用的

    本文主要聚焦pip install安裝Python包時(shí)出現(xiàn)的“Backend ‘setuptools.build_meta’ is unavailable”報(bào)錯(cuò)的原因與解決方法,希望可以幫助開發(fā)者徹底解決該報(bào)錯(cuò),同時(shí)給出規(guī)范構(gòu)建后端配置的預(yù)防策略
    2026-03-03
  • python實(shí)現(xiàn)彈窗祝福效果

    python實(shí)現(xiàn)彈窗祝福效果

    這篇文章主要為大家詳細(xì)介紹了python實(shí)現(xiàn)彈窗祝福效果,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2019-04-04
  • Python實(shí)現(xiàn)隨機(jī)森林回歸與各自變量重要性分析與排序

    Python實(shí)現(xiàn)隨機(jī)森林回歸與各自變量重要性分析與排序

    這篇文章主要為大家詳細(xì)介紹了在Python環(huán)境中,實(shí)現(xiàn)隨機(jī)森林(Random Forest,RF)回歸與各自變量重要性分析與排序的過程,感興趣的小伙伴可以了解一下
    2023-02-02
  • 詳解python中index()、find()方法

    詳解python中index()、find()方法

    本文通過實(shí)例代碼給大家介紹了python中index()、find()方法,文中給大家提到了Python將DataFrame的某一列作為index的方法,需要的朋友可以參考下
    2019-08-08
  • Python實(shí)現(xiàn)圖像的二進(jìn)制與base64互轉(zhuǎn)

    Python實(shí)現(xiàn)圖像的二進(jìn)制與base64互轉(zhuǎn)

    這篇文章主要為大家介紹了如何在Python中使用OpenCV從而實(shí)現(xiàn)圖像轉(zhuǎn)base64編碼、圖像轉(zhuǎn)二進(jìn)制編碼、二進(jìn)制轉(zhuǎn)圖像等功能,感興趣的可以跟上小編一起學(xué)習(xí)一下
    2022-03-03
  • 啟動(dòng)targetcli時(shí)遇到錯(cuò)誤解決辦法

    啟動(dòng)targetcli時(shí)遇到錯(cuò)誤解決辦法

    這篇文章主要介紹了啟動(dòng)targetcli時(shí)遇到錯(cuò)誤解決辦法的相關(guān)資料,希望通過本文能幫助到大家,讓大家遇到這樣的錯(cuò)誤解決,需要的朋友可以參考下
    2017-10-10
  • Python深度學(xué)習(xí)之FastText實(shí)現(xiàn)文本分類詳解

    Python深度學(xué)習(xí)之FastText實(shí)現(xiàn)文本分類詳解

    FastText是一種典型的深度學(xué)習(xí)詞向量的表示方法,它非常簡單通過Embedding層將單詞映射到稠密空間,然后將句子中所有的單詞在Embedding空間中進(jìn)行平均,進(jìn)而完成分類操作
    2022-09-09
  • 詳解pygame捕獲鍵盤事件的兩種方式

    詳解pygame捕獲鍵盤事件的兩種方式

    這篇文章主要介紹了詳解pygame捕獲鍵盤事件的兩種方式,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2021-04-04

最新評論

夏河县| 肥东县| 红河县| 兴和县| 咸丰县| 远安县| 开封市| 南昌县| 依安县| 饶阳县| 云龙县| 孝感市| 文安县| 鄯善县| 内黄县| 绥芬河市| 乡宁县| 石泉县| 得荣县| 万载县| 中西区| 黄冈市| 江华| 神农架林区| 裕民县| 郴州市| 永吉县| 东兰县| 育儿| 社旗县| 时尚| 新田县| 西宁市| 扎赉特旗| 汕尾市| 黄龙县| 靖江市| 菏泽市| 青川县| 裕民县| 冀州市|