python学习贴
Re: python学习贴
https://baijiahao.baidu.com/s?id=178722 ... der&for=pc
“眼里有活”的斯坦福机器人来一个?数十种家务全包 成本仅约3万美元
https://www.bilibili.com/video/BV1g64y1 ... e4d0d353be
前一段时间第一次在头条刷到这个视频的时候,真的的极度震撼!深感AI 是文明发展的大趋势。如果不去了解,不去跟随,感觉会非常遗憾!也可能会在日后 跟不上时代的脚步!
刚刚找这个视频的时候,看了一些花絮,这个家政机器人,目前的学习能力,应该属于机械动作记忆。不属于视觉神经网络的深度学习。但是,这只是个初级阶段的产品、而且,团队把软件和硬件 全部做了开源。这样一来,肯定会助力加速的迭代。虽然 AI视觉实现起来可能会有一些困难,但,肯定会一步一步被解决。以我目前的知识理解:主要还是机器在空间内定位的解决方案,以及 算法 中央处理器能力,GPU能力 的提升。我感觉:简单功能的 视觉深度学习家务机器人 的出现,应该不会很久
“眼里有活”的斯坦福机器人来一个?数十种家务全包 成本仅约3万美元
https://www.bilibili.com/video/BV1g64y1 ... e4d0d353be
前一段时间第一次在头条刷到这个视频的时候,真的的极度震撼!深感AI 是文明发展的大趋势。如果不去了解,不去跟随,感觉会非常遗憾!也可能会在日后 跟不上时代的脚步!
刚刚找这个视频的时候,看了一些花絮,这个家政机器人,目前的学习能力,应该属于机械动作记忆。不属于视觉神经网络的深度学习。但是,这只是个初级阶段的产品、而且,团队把软件和硬件 全部做了开源。这样一来,肯定会助力加速的迭代。虽然 AI视觉实现起来可能会有一些困难,但,肯定会一步一步被解决。以我目前的知识理解:主要还是机器在空间内定位的解决方案,以及 算法 中央处理器能力,GPU能力 的提升。我感觉:简单功能的 视觉深度学习家务机器人 的出现,应该不会很久
看长做短,高抛低吸,日内做T,掌控心理!
Re: python学习贴
import fitz
from pptx import Presentation
pdf_file = "input.pdf"
ppt = Presentation()
doc = fitz.open(pdf_file)
for i in range(doc.page_count):
page = doc.load_page(i)
pix = page.get_pixmap()
img = f"page_{i}.png"
pix.save(img)
slide = ppt.slides.add_slide(ppt.slide_layouts[1])
slide.shapes.add_picture(img, 0, 0, ppt.slide_width, ppt.slide_height)
ppt.save("output.pptx")
将pdf转化成ppt(图片)
注意将input和output替代成想要的文件(路径)就可以了
from pptx import Presentation
pdf_file = "input.pdf"
ppt = Presentation()
doc = fitz.open(pdf_file)
for i in range(doc.page_count):
page = doc.load_page(i)
pix = page.get_pixmap()
img = f"page_{i}.png"
pix.save(img)
slide = ppt.slides.add_slide(ppt.slide_layouts[1])
slide.shapes.add_picture(img, 0, 0, ppt.slide_width, ppt.slide_height)
ppt.save("output.pptx")
将pdf转化成ppt(图片)
注意将input和output替代成想要的文件(路径)就可以了
看图出奇迹,看基本面穷三代
Re: python学习贴
用网络资源,修改了制造了一个倒计时的界面(用处不大)
from tkinter import *
import time
from playsound import playsound
## pad with zeros
def pad_with_zeros(number, length):
return str(number).zfill(length)
## display window
root = Tk()
root.geometry('1200x900')
root.resizable(0,0)
root.config(bg ='blanched almond')
root.title('倒计时器')
Label(root, text = '倒计时器' , font = 'arial 50 bold', bg ='papaya whip').pack()
#display current time#######################
Label(root, font ='arial 45 bold', text = '北京时间 :', bg = 'papaya whip').place(x = 140 ,y = 170)
####fun to display current time
def clock():
clock_time = time.strftime('%H:%M:%S %p')
curr_time.config(text = clock_time)
curr_time.after(1000,clock)
curr_time =Label(root, font ='arial 45 bold', text = '', fg = 'gray25' ,bg ='papaya whip')
curr_time.place(x = 440 , y = 170)
clock()
#######################timer countdown##########
#storing seconds
sec = StringVar()
Entry(root, textvariable = sec, width = 2, font = 'arial 42').place(x=650, y=355)
sec.set('00')
#storing minutes
mins= StringVar()
Entry(root, textvariable = mins, width =2, font = 'arial 42').place(x=550, y=355)
mins.set('00')
# storing hours
hrs= StringVar()
Entry(root, textvariable = hrs, width =2, font = 'arial 42').place(x=450, y=355)
hrs.set('00')
##########fun to start countdown
def countdown():
times = int(hrs.get())*3600+ int(mins.get())*60 + int(sec.get())
while times > -1:
minute,second = (times // 60 , times % 60)
hour = 0
if minute > 60:
hour , minute = (minute // 60 , minute % 60)
#second = pad_with_zeros(second,2)
#minute = pad_with_zeros(minute,2)
#hour = pad_with_zeros(hour,2)
sec.set(second)
mins.set(minute)
hrs.set(hour)
root.update()
time.sleep(1)
if(times == 0):
playsound('Loud_Alarm_Clock_Buzzer.mp3')
sec.set('00')
mins.set('00')
hrs.set('00')
times -= 1
Label(root, font ='arial 45 bold', text = '倒计时:', bg ='papaya whip').place(x = 140 ,y = 350)
Button(root, text='开始', bd ='5', command = countdown, bg = 'antique white', font = 'arial 40 bold').place(x=450, y=510)
root.mainloop()
from tkinter import *
import time
from playsound import playsound
## pad with zeros
def pad_with_zeros(number, length):
return str(number).zfill(length)
## display window
root = Tk()
root.geometry('1200x900')
root.resizable(0,0)
root.config(bg ='blanched almond')
root.title('倒计时器')
Label(root, text = '倒计时器' , font = 'arial 50 bold', bg ='papaya whip').pack()
#display current time#######################
Label(root, font ='arial 45 bold', text = '北京时间 :', bg = 'papaya whip').place(x = 140 ,y = 170)
####fun to display current time
def clock():
clock_time = time.strftime('%H:%M:%S %p')
curr_time.config(text = clock_time)
curr_time.after(1000,clock)
curr_time =Label(root, font ='arial 45 bold', text = '', fg = 'gray25' ,bg ='papaya whip')
curr_time.place(x = 440 , y = 170)
clock()
#######################timer countdown##########
#storing seconds
sec = StringVar()
Entry(root, textvariable = sec, width = 2, font = 'arial 42').place(x=650, y=355)
sec.set('00')
#storing minutes
mins= StringVar()
Entry(root, textvariable = mins, width =2, font = 'arial 42').place(x=550, y=355)
mins.set('00')
# storing hours
hrs= StringVar()
Entry(root, textvariable = hrs, width =2, font = 'arial 42').place(x=450, y=355)
hrs.set('00')
##########fun to start countdown
def countdown():
times = int(hrs.get())*3600+ int(mins.get())*60 + int(sec.get())
while times > -1:
minute,second = (times // 60 , times % 60)
hour = 0
if minute > 60:
hour , minute = (minute // 60 , minute % 60)
#second = pad_with_zeros(second,2)
#minute = pad_with_zeros(minute,2)
#hour = pad_with_zeros(hour,2)
sec.set(second)
mins.set(minute)
hrs.set(hour)
root.update()
time.sleep(1)
if(times == 0):
playsound('Loud_Alarm_Clock_Buzzer.mp3')
sec.set('00')
mins.set('00')
hrs.set('00')
times -= 1
Label(root, font ='arial 45 bold', text = '倒计时:', bg ='papaya whip').place(x = 140 ,y = 350)
Button(root, text='开始', bd ='5', command = countdown, bg = 'antique white', font = 'arial 40 bold').place(x=450, y=510)
root.mainloop()
看图出奇迹,看基本面穷三代
Re: python学习贴
from pyecharts import options as opts
from pyecharts. charts import Radar
# 数据
data = [
{"value":[7,9,8,7,8,10],"name" :"实际值"},
{"value":[10,10,10,10,10,10],"name" :"目标值"}
]
#指示器名称
indicator = [
{"name":"上课专注力","max":10},
{"name":"参与度","max":10},
{"name":"互动性","max":10},
{"name":"纪律性","max":10},
{"name":"作业评分","max":10},
{"name":"学习成果","max":10},
]
#绘图
radar = (
Radar()
.set_global_opts(title_opts=opts.TitleOpts(title="学习情况反馈"))
.add_schema(schema=indicator)
.add("学习情况反馈(每项满分:10)",data, label_opts=opts.LabelOpts(is_show=False))
)
#展示
radar.render_notebook()
from pyecharts. charts import Radar
# 数据
data = [
{"value":[7,9,8,7,8,10],"name" :"实际值"},
{"value":[10,10,10,10,10,10],"name" :"目标值"}
]
#指示器名称
indicator = [
{"name":"上课专注力","max":10},
{"name":"参与度","max":10},
{"name":"互动性","max":10},
{"name":"纪律性","max":10},
{"name":"作业评分","max":10},
{"name":"学习成果","max":10},
]
#绘图
radar = (
Radar()
.set_global_opts(title_opts=opts.TitleOpts(title="学习情况反馈"))
.add_schema(schema=indicator)
.add("学习情况反馈(每项满分:10)",data, label_opts=opts.LabelOpts(is_show=False))
)
#展示
radar.render_notebook()
看图出奇迹,看基本面穷三代