【保姆级教程】批量下载Pexels视频Python脚本(以HumanVid数据集为例)

news2024/12/23 2:17:29

目录

方案一:转换链接为download模式

方案二:获取源链接后下载

附录:HumanVid链接


方案一:转换链接为download模式

将下载链接的后缀加入 /download 然后用下面的脚本下载:

import argparse
import json
import os
import time

import requests
import tqdm
from pexels_api import API

PEXELS_API_KEY = os.environ['PEXELS_KEY']
MAX_IMAGES_PER_QUERY = 100
RESULTS_PER_PAGE = 10
PAGE_LIMIT = MAX_IMAGES_PER_QUERY / RESULTS_PER_PAGE


def get_sleep(t):
    def sleep():
        time.sleep(t)
    return sleep


def main(args):
    sleep = get_sleep(args.sleep)

    api = API(PEXELS_API_KEY)
    query = args.query

    page = 1
    counter = 0

    photos_dict = {}

    # Step 1: Getting urls and meta information
    while page <= PAGE_LIMIT:
        api.search(query, page=page, results_per_page=RESULTS_PER_PAGE)
        photos = api.get_entries()

        for photo in tqdm.tqdm(photos):
            photos_dict[photo.id] = vars(photo)['_Photo__photo']
            counter += 1

        if not api.has_next_page:
            break

        page += 1
        sleep()

    print(f"Finishing at page: {page}")
    print(f"Images were processed: {counter}")

    # Step 2: Downloading
    if photos_dict:
        os.makedirs(args.path, exist_ok=True)

        # Saving dict
        with open(os.path.join(args.path, f'{query}.json'), 'w') as fout:
            json.dump(photos_dict, fout)

        for val in tqdm.tqdm(photos_dict.values()):
            url = val['src'][args.resolution]
            fname = os.path.basename(val['src']['original'])
            image_path = os.path.join(args.path, fname)

            if not os.path.isfile(image_path):  # ignore if already downloaded
                response = requests.get(url, stream=True)

                with open(image_path, 'wb') as outfile:
                    outfile.write(response.content)
            else:
                print(f"File exists: {image_path}")


if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument('--query', type=str, required=True)
    parser.add_argument('--path', type=str, default='./results_pexels')
    parser.add_argument('--resolution', choices=['original', 'large2x', 'large',
                                                 'medium', 'small', 'portrait',
                                                 'landscape', 'tiny'], default='original')
    parser.add_argument('--sleep', type=float, default=0.1)
    args = parser.parse_args()
    main(args)

方案二:获取源链接后下载

例如这个链接:

https://www.pexels.com/video/5901660/

浏览器打开:

然后单击右键,获取视频链接地址:

这个链接地址就是原视频的链接地址了,因此可以直接wget下载,也可以用response下载。

那么用脚本如何批量下载呢?以下是源代码:

import os
import requests
from tqdm import tqdm

folder_path = "./videos/vertical1"
os.makedirs(folder_path, exist_ok=True)
url_path = "./pexels-vertical-urls.txt"

headers = {"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36"}

def get_video(video_id, url):
    response = requests.get(url , stream=True, headers=headers)
    if response.status_code == 200:
        with open(save_path, 'wb') as outfile:
            outfile.write(response.content)
            return True
    else:
        return False

if __name__ == "__main__":
    error_cnt = 0
    error_list = []
    with open(url_path, 'r', encoding='utf-8') as file:

        for line in tqdm(file):
            try:
                origin_url = line.strip()
                
                video_id = origin_url.split('/')[-2]
                url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-hd_1080_1920_30fps.mp4"
                save_path = os.path.join(folder_path, str(video_id)+".mp4")

                if os.path.exists(save_path):
                    # print(f"{save_path} exists!")
                    continue
                
                if not get_video(video_id, url):
                    url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-hd_1080_1920_25fps.mp4"
                    if not get_video(video_id, url):
                        url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-uhd_1440_2732_25fps.mp4"
                        if not get_video(video_id, url):
                            url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-uhd_1440_2560_24fps.mp4"
                            if not get_video(video_id, url):
                                url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-hd_1066_1920_25fps.mp4"
                                if not get_video(video_id, url):
                                    url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-hd_720_1280_24fps.mp4"
                                    if not get_video(video_id, url):
                                        url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-hd_720_1280_20fps.mp4"
                                        if not get_video(video_id, url):
                                            url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-hd_1080_1902_24fps.mp4"
                                            if not get_video(video_id, url):
                                                url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-uhd_1440_2732_24fps.mp4"
                                                if not get_video(video_id, url):      
                                                    url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-hd_720_1280_25fps.mp4"
                                                    if not get_video(video_id, url):   
                                                        url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-uhd_1440_2496_30fps.mp4"
                                                        if not get_video(video_id, url):               
                                                            url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-uhd_1440_2732_30fps.mp4"
                                                            if not get_video(video_id, url):     
                                                                url = f"https://videos.pexels.com/video-files/{video_id}/uhd_25fps.mp4"
                                                                if not get_video(video_id, url):      
                                                                    url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-hd_1080_1830_25fps.mp4"
                                                                    if not get_video(video_id, url):                                                                                                                                                                                                                                                                                                                                
                                                                        print(f"The url is {url} response error! the response. The video id is: {video_id}")
                                                                        error_cnt += 1
                                                                        error_list.append(video_id)
            except Exception as e:
                print(e)
                error_cnt += 1
                error_list.append(video_id)
                continue
    
    print(f"error_cnt: {error_cnt}")
    print(error_list)
import os
import requests
from tqdm import tqdm

folder_path = "./videos/horizontal1"
os.makedirs(folder_path, exist_ok=True)
url_path = "./pexels-horizontal-urls.txt"

headers = {"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36"}

def get_video(video_id, url, save_path):
    response = requests.get(url , stream=True, headers=headers)
    if response.status_code == 200:
        with open(save_path, 'wb') as outfile:
            outfile.write(response.content)
            return True
    else:
        return False

if __name__ == "__main__":
    error_cnt = 0
    error_list = []
    with open(url_path, 'r', encoding='utf-8') as file:

        for line in tqdm(file):
            try:
                origin_url = line.strip()
                
                video_id = origin_url.split('/')[-2]
                url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-uhd_2732_1440_25fps.mp4"
                save_path = os.path.join(folder_path, str(video_id)+".mp4")

                if os.path.exists(save_path):
                    # print(f"{save_path} exists!")
                    continue
                
                # https://videos.pexels.com/video-files/5547220/5547220-hd_1280_720_25fps.
                # https://videos.pexels.com/video-files/4156500/4156500-hd_1608_1080_30fps.mp4
                # https://videos.pexels.com/video-files/8142750/uhd_25fps.mp4
                # https://videos.pexels.com/video-files/4536510/4536510-hd_1280_720_50fps.mp4
                if not get_video(video_id, url, save_path):
                    url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-uhd_2732_1440_30fps.mp4"
                    if not get_video(video_id, url, save_path):
                        url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-uhd_2560_1440_24fps.mp4"
                        if not get_video(video_id, url, save_path):
                            url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-uhd_2560_1440_25fps.mp4"
                            if not get_video(video_id, url, save_path):
                                url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-uhd_2560_1440_30fps.mp4"
                                if not get_video(video_id, url, save_path):
                                    url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-hd_1920_1080_25fps.mp4"
                                    if not get_video(video_id, url, save_path):
                                        url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-uhd_2732_1440_24fps.mp4"
                                        if not get_video(video_id, url, save_path):
                                            url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-hd_1920_1080_24fps.mp4"
                                            if not get_video(video_id, url, save_path):
                                                url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-hd_1920_1080_30fps.mp4"
                                                if not get_video(video_id, url, save_path):
                                                    url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-uhd_2560_1080_25fps.mp4"
                                                    if not get_video(video_id, url, save_path):
                                                        url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-uhd_2732_1318_30fps.mp4"
                                                        if not get_video(video_id, url, save_path):
                                                            url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-uhd_2732_1122_25fps.mp4"
                                                            if not get_video(video_id, url, save_path):     
                                                                url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-2732_1026_25fps.mp4"
                                                                if not get_video(video_id, url, save_path):
                                                                    url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-hd_1280_720_25fps.mp4"
                                                                    if not get_video(video_id, url, save_path):     
                                                                        url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-hd_1608_1080_30fps.mp4"
                                                                        if not get_video(video_id, url, save_path):    
                                                                            url = f"https://videos.pexels.com/video-files/{video_id}/uhd_25fps.mp4"
                                                                            if not get_video(video_id, url, save_path):          
                                                                                url = f"https://videos.pexels.com/video-files/{video_id}/{video_id}-hd_1280_720_50fps.mp4"
                                                                                if not get_video(video_id, url, save_path):                                                                                                                                                                                                                                                                                                                                                                                                                    
                                                                                    print(f"The url is {url} response error! The video id is: {video_id}")
                                                                                    error_cnt += 1
                                                                                    error_list.append(video_id)
            except Exception as e:
                print(e)
                error_cnt += 1
                error_list.append(video_id)
    
    print(f"error_cnt: {error_cnt}")
    print(error_list)

附录:HumanVid链接

pexels-vertical-urls.txt

https://www.pexels.com/video/7080900/download
https://www.pexels.com/video/6952520/download
https://www.pexels.com/video/6349070/download
https://www.pexels.com/video/7331390/download
https://www.pexels.com/video/7570280/download
https://www.pexels.com/video/6860990/download
https://www.pexels.com/video/6944620/download
https://www.pexels.com/video/6764050/download
https://www.pexels.com/video/8873210/download
https://www.pexels.com/video/6389830/download
https://www.pexels.com/video/6565400/download
https://www.pexels.com/video/6930970/download
https://www.pexels.com/video/8469970/download
https://www.pexels.com/video/7326810/download
https://www.pexels.com/video/4325510/download
https://www.pexels.com/video/7169950/download
https://www.pexels.com/video/8926860/download
https://www.pexels.com/video/5995130/download
https://www.pexels.com/video/8217050/download
https://www.pexels.com/video/8224270/download
https://www.pexels.com/video/8371250/download
https://www.pexels.com/video/6455330/download
https://www.pexels.com/video/9947050/download
https://www.pexels.com/video/9047370/download
https://www.pexels.com/video/6688050/download
https://www.pexels.com/video/4838220/download
https://www.pexels.com/video/7239800/download
https://www.pexels.com/video/5999210/download
https://www.pexels.com/video/9187960/download
https://www.pexels.com/video/6487450/download
https://www.pexels.com/video/7140160/download
https://www.pexels.com/video/5999650/download
https://www.pexels.com/video/7077040/download
https://www.pexels.com/video/3894700/download
https://www.pexels.com/video/6082570/download
https://www.pexels.com/video/7579880/download
https://www.pexels.com/video/8401740/download
https://www.pexels.com/video/8217240/download
https://www.pexels.com/video/8944110/download
https://www.pexels.com/video/5683800/download
https://www.pexels.com/video/7551190/download
https://www.pexels.com/video/6732430/download
https://www.pexels.com/video/8027280/download
https://www.pexels.com/video/6347120/download
https://www.pexels.com/video/8216940/download
https://www.pexels.com/video/7424400/download
https://www.pexels.com/video/8436000/download
https://www.pexels.com/video/6446180/download
https://www.pexels.com/video/6799740/download
https://www.pexels.com/video/6935810/download
https://www.pexels.com/video/7957280/download
https://www.pexels.com/video/8382490/download
https://www.pexels.com/video/6306030/download
https://www.pexels.com/video/8456640/download
https://www.pexels.com/video/8113110/download
https://www.pexels.com/video/7673610/download
https://www.pexels.com/video/6197560/download
https://www.pexels.com/video/6198550/download
https://www.pexels.com/video/9371260/download
https://www.pexels.com/video/12910150/download
https://www.pexels.com/video/5834600/download
https://www.pexels.com/video/7730520/download
https://www.pexels.com/video/7140210/download
https://www.pexels.com/video/5716220/download
https://www.pexels.com/video/7706010/download
https://www.pexels.com/video/6172960/download
https://www.pexels.com/video/7644230/download
https://www.pexels.com/video/7173140/download
https://www.pexels.com/video/6578980/download
https://www.pexels.com/video/6774470/download
https://www.pexels.com/video/6570560/download
https://www.pexels.com/video/7484280/download
https://www.pexels.com/video/7896900/download
https://www.pexels.com/video/6617220/download
https://www.pexels.com/video/6944280/download
https://www.pexels.com/video/8416580/download
https://www.pexels.com/video/8511010/download
https://www.pexels.com/video/8076890/download
https://www.pexels.com/video/5981910/download
https://www.pexels.com/video/6707470/download
https://www.pexels.com/video/5901660/download
https://www.pexels.com/video/5319930/download
https://www.pexels.com/video/7329850/download
https://www.pexels.com/video/9613990/download
https://www.pexels.com/video/5384950/download
https://www.pexels.com/video/6437920/download
https://www.pexels.com/video/7148070/download
https://www.pexels.com/video/8111740/download
https://www.pexels.com/video/4540340/download
https://www.pexels.com/video/9001930/download
https://www.pexels.com/video/12331340/download
https://www.pexels.com/video/6784470/download
https://www.pexels.com/video/5515570/download
https://www.pexels.com/video/5973230/download
https://www.pexels.com/video/7198890/download
https://www.pexels.com/video/7267510/download
https://www.pexels.com/video/6730930/download
https://www.pexels.com/video/8057650/download
https://www.pexels.com/video/7424390/download
https://www.pexels.com/video/7550840/download
https://www.pexels.com/video/8362620/download
https://www.pexels.com/video/8376450/download
https://www.pexels.com/video/8056690/download
https://www.pexels.com/video/8087310/download
https://www.pexels.com/video/8544230/download
https://www.pexels.com/video/4860330/download
https://www.pexels.com/video/12433210/download
https://www.pexels.com/video/4753980/download
https://www.pexels.com/video/5184350/download
https://www.pexels.com/video/6323270/download
https://www.pexels.com/video/7945890/download
https://www.pexels.com/video/8777100/download
https://www.pexels.com/video/8170730/download
https://www.pexels.com/video/5370830/download
https://www.pexels.com/video/7671930/download
https://www.pexels.com/video/8224600/download
https://www.pexels.com/video/4098440/download
https://www.pexels.com/video/6153970/download
https://www.pexels.com/video/6615310/download
https://www.pexels.com/video/6892550/download
https://www.pexels.com/video/8087090/download
https://www.pexels.com/video/4976900/download
https://www.pexels.com/video/7354940/download
https://www.pexels.com/video/8345820/download
https://www.pexels.com/video/4671960/download
https://www.pexels.com/video/6875170/download
https://www.pexels.com/video/7699750/download
https://www.pexels.com/video/10536910/download
https://www.pexels.com/video/8217090/download
https://www.pexels.com/video/8729420/download
https://www.pexels.com/video/6913260/download
https://www.pexels.com/video/7329840/download
https://www.pexels.com/video/8448090/download
https://www.pexels.com/video/6890230/download
https://www.pexels.com/video/3201200/download
https://www.pexels.com/video/6447700/download
https://www.pexels.com/video/6245810/download
https://www.pexels.com/video/7187450/download
https://www.pexels.com/video/8322000/download
https://www.pexels.com/video/6324550/download
https://www.pexels.com/video/6525480/download
https://www.pexels.com/video/6389560/download
https://www.pexels.com/video/5974320/download
https://www.pexels.com/video/7545940/download
https://www.pexels.com/video/4507230/download
https://www.pexels.com/video/7480490/download
https://www.pexels.com/video/6132710/download
https://www.pexels.com/video/7525810/download
https://www.pexels.com/video/7901510/download
https://www.pexels.com/video/7016530/download
https://www.pexels.com/video/7680770/download
https://www.pexels.com/video/7793360/download
https://www.pexels.com/video/6202100/download
https://www.pexels.com/video/7809650/download
https://www.pexels.com/video/6984840/download
https://www.pexels.com/video/7540250/download
https://www.pexels.com/video/7253250/download
https://www.pexels.com/video/7804490/download
https://www.pexels.com/video/7728220/download
https://www.pexels.com/video/8047410/download
https://www.pexels.com/video/7597260/download
https://www.pexels.com/video/6951180/download
https://www.pexels.com/video/6297140/download
https://www.pexels.com/video/7957040/download
https://www.pexels.com/video/9511850/download
https://www.pexels.com/video/8987290/download
https://www.pexels.com/video/6930230/download
https://www.pexels.com/video/6245510/download
https://www.pexels.com/video/5124240/download
https://www.pexels.com/video/7576310/download
https://www.pexels.com/video/6547780/download
https://www.pexels.com/video/7881190/download
https://www.pexels.com/video/7969760/download
https://www.pexels.com/video/8160260/download
https://www.pexels.com/video/7551200/download
https://www.pexels.com/video/8043430/download
https://www.pexels.com/video/6063030/download
https://www.pexels.com/video/8192040/download

正文放不下了…

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2173065.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

react 状态管理

Redux Redux是React中常用的状态管理组件&#xff0c;类似于Vue中的Pinia(Vuex)&#xff0c;可以独立于框架运行 作用&#xff1a; 通过集中管理的方式管理应用的状态 配套工具 在react中使用redux&#xff0c;官方要求按照两个插件&#xff0c;Redux Toolkit 和 react-red…

【补充】倒易点阵基本性质

&#xff08;1&#xff09;任意倒易矢量 r h k l ∗ h a ∗ k b ∗ l c ∗ \mathbf{r}_{hkl}^* h\mathbf{a^*} k\mathbf{b^*} l\mathbf{c^*} rhkl∗​ha∗kb∗lc∗必然垂直于正空间中的(hkl)晶面。 正空间中的(hkl)晶面的法向是[hkl]&#xff0c;和坐标轴的交点为A、B、…

基于yolov8的辣椒缺陷检测系统python源码+onnx模型+评估指标曲线+精美GUI界面

阅读本文请注意该系统设计是针对单个辣椒进行缺陷检测&#xff0c;具体可以在训练数据集查看数据集具体情况 【算法介绍】 基于YOLOv8的辣椒缺陷检测系统是一种利用深度学习技术&#xff0c;特别是YOLOv8算法&#xff0c;来自动识别和检测辣椒表面缺陷的先进系统。YOLOv8作为…

Serilog文档翻译系列(六) - 可用的接收器、增强器、格式化输出

01、提供的接收器 Serilog 使用接收器将日志事件以各种格式写入存储。许多接收器由更广泛的 Serilog 社区开发和支持&#xff1b;可以通过在 NuGet 上搜索 serilog 标签找到。 02、增强器 日志事件可以通过多种方式增强属性。通过 NuGet 提供了一些预构建的增强器&#xff…

openEuler 20.03,22.03 一键部署Oracle21c zip

oracle21c前言 Oracle开发的关系数据库产品因性能卓越而闻名,Oracle数据库产品为财富排行榜上的前1000家公司所采用,许多大型网站也选用了Oracle系统,是世界最好的数据库产品。此外,Oracle公司还开发其他应用程序和软件。同时,Oracle在英语里还是“神谕”的意思,意为“替…

十进制与ip地址转换公式

1、十进制转为ip地址公式 TEXT(INT(C2/16777216),“0”)&“.”&TEXT(INT((C2-INT(C2/16777216)*16777216)/65536),“0”)&“.”&TEXT(INT((C2-INT(C2/16777216)*16777216-INT((C2-INT(C2/16777216)*16777216)/65536)*65536)/256),“0”)&“.”&TEXT(MO…

SpringBoot的概述与搭建

目录 一.SpringBoot的概述 二.SpringBoot 特点 三.SpringBoot 的核心功能 3.1起步依赖 3.2自动配置 四.SpringBoot 开发环境构建 五.SpringBoot 配置文件 六.SpringBoot数据访问管理 七.springboot注解 八.springboot集成mybatis 九.springboot全局异常捕获与处理 一…

数据集-目标检测系列-豹子 猎豹 检测数据集 leopard>> DataBall

数据集-目标检测系列-豹子 猎豹 检测数据集 leopard>> DataBall 数据集-目标检测系列-豹子 猎豹 检测数据集 leopard 数据量&#xff1a;5k 想要进一步了解&#xff0c;请联系。 DataBall 助力快速掌握数据集的信息和使用方式&#xff0c;会员享有 百种数据集&#x…

C#测试调用FreeSpire.PDFViewer浏览PDF文件

Free Spire.PDFViewer是商业版Spire.PDFViewer的社区版本&#xff0c;支持以控件形式打开并查看PDf文件&#xff0c;但由于是免费版本&#xff0c;存在使用限制&#xff0c;打开的PDF文档只显示前10页内容。如果日常操作的pdf文件都不超过10页&#xff0c;可以考虑使用Free Spi…

我是如何将 Java 基础 docker 镜像大小从 674Mb 优化到 58Mb的

我是如何将 Java 基础 docker 镜像大小从 674Mb 优化到 58Mb的 如果您是 Java 开发人员&#xff0c;并且正在使用 Docker 打包应用程序&#xff0c;您可能已经注意到&#xff0c;即使是“hello world”类型的项目&#xff0c;最终镜像的大小也可能非常大。在本文中&#xff0c…

DAY16||513.找树左下角的值 |路径总和|从中序与后序遍历序列构造二叉树

513.找树左下角的值 题目&#xff1a;513. 找树左下角的值 - 力扣&#xff08;LeetCode&#xff09; 给定一个二叉树的 根节点 root&#xff0c;请找出该二叉树的 最底层 最左边 节点的值。 假设二叉树中至少有一个节点。 示例 1: 输入: root [2,1,3] 输出: 1示例 2: 输入: […

InternVL 微调实践

任务 follow 教学文档和视频使用QLoRA进行微调模型&#xff0c;复现微调效果&#xff0c;并能成功讲出梗图. 复现过程 参考教程部署&#xff1a;https://github.com/InternLM/Tutorial/blob/camp3/docs/L2/InternVL/joke_readme.md 训练 合并权重&&模型转换 pyth…

多旋翼无人机“仿鸟类”精确拦截飞行目标,助力低空安全

摘要&#xff1a; 使用低成本携带捷联式相机的无人机拦截低空入侵目标是一种具有竞争力的选择。然而&#xff0c;非合作目标的恶意机动和摄像头的耦合使得这项任务充满挑战。为了解决这个问题&#xff0c;提出了一种基于比例导引且具有视场保持能力的基于图像的视觉伺服&#x…

【d52】【Java】【力扣】19.删除链表的倒数第N个节点

思路 1.遍历数组,统计个数&#xff0c;记为total 2.计算出需要被删除的节点 是正数第几个&#xff0c;记做order 3.遍历到order-1,,然后执行删除下一个节点的操作 这里遍历到order-1&#xff0c;是因为想要删除一个节点&#xff0c;需要操作的是它前一个节点的next 代码 /…

JAVA使用Scanner类的nextLint()方法无法正确读取中文。

在练习的时候&#xff0c;我发现我使用Scanner类的nextLint&#xff08;&#xff09;方法无法正确读取到中文了。检查了我的idea编辑器&#xff0c;用的编码格式也是”utf-8“。所以编码格式没有问题。 问题如下棉两张图所示&#xff0c;我输入宝马后&#xff0c;控制台不打印…

助力申报“山东省首台套技术装备”,安畅检测提供第三方检测服务

9月24日&#xff0c;山东省工业和信息化厅发布了《关于组织2024年度山东省首台&#xff08;套&#xff09;技术装备认定工作的通知》。 《通知》中对申报范围、申请条件及申报程序做出了明确规定&#xff0c;并在附件中对申请材料做出了要求。 ★检测报告要求 在《通知》附件…

面试前需要准备什么?

面试前的准备是一个细致且全面的过程&#xff0c;它不仅关乎到你能否在面试中展现出最佳状态&#xff0c;还直接影响到你能否成功获得心仪的职位。以下是一个较为详尽的、接近2000字的面试前准备指南&#xff1a; 一.自我评估与定位 1.深入了解自己 在准备面试之前&#xff…

再谈智慧园区

随着AI的兴起&#xff0c;其影响力将渗透到各行各业。产业园区也不例外。特别是江园科技智慧园区在园区运营上&#xff0c;从早期的信息化&#xff0c;到数字化、智能化&#xff0c;智慧园区是一个不可回避的话题。 01 江园科技智慧园区 无论名称或概念怎么办&#xff0c;产…

Halcon实用系列1-识别二维条码

在做项目时&#xff0c;之前使用的是某康的智能读码器&#xff0c;综合考虑成本&#xff0c;可通过相机拍照来读取图片的二维码&#xff0c;我这边用Halcon来实现。 Halcon代码如下&#xff1a; *创建模型 create_data_code_2d_model(Data Matrix ECC 200, [], [], DataCodeH…

微信小程序map组件自定义气泡真机不显示

最近遇到一个需求需要使用uniapp的map自定义气泡 &#xff0c;做完之后发现在模拟器上好好的&#xff0c;ios真机不显示&#xff0c;安卓页数时好时不好的 一番查询发现是小程序的老问题了&#xff0c;网上的方法都试了也没能解决 后来看到有人说用nvue可以正常显示&#xff0c…