python you-get下载视频下载到哪里_使用you-get下载视频网站的各种视频的最全面的简明方法...

最近因为要下一些视频来离线学习,可是,不是加密就是搞不到地址,很麻烦,学习了一下you-get,发现此工具大善,然而注定不是经常使用,故写下此文立帖备忘。

第一步安装python,因为you-get是用python写的,需要python的环境支持。

1.1 到https://www.python.org/downloads/下载,直接点那个Download Python x.x.x下载最新版即可,像这样:

1ad94c347e92

下载python

1.2 下载下来的用管理员权限安装,选默认的选项安装就行了。

接下来安装you-get.

2.1 以管理员权限运行命令提示符,像我的这样:

1ad94c347e92

以管理员权限运行cmd

2.2 执行下面的命令:

pip install you-get

会显示类似如下内容:

C:\WINDOWS\system32>pip install you-get

Collecting you-get

Using cached https://files.pythonhosted.org/packages/20/35/4979bb3315952a9cb20f2585455bec7ba113db5647c5739dffbc542e8761/you_get-0.4.1328-py3-none-any.whl

Installing collected packages: you-get

Successfully installed you-get-0.4.1328

You are using pip version 19.0.3, however version 19.2.3 is available.

You should consider upgrading via the 'python -m pip install --upgrade pip' command.

最底下说的是我的pip版本太低了,不用理它。关键我们在意的应该是它说:

1ad94c347e92

显示已经成功安装了

2.3 如果担心you-get不是最新版本,可以多执行一下以下命令来更新一下you-get的版本,其实没有必要,我们的是新鲜安装,这里写出来主要是备忘一下这个命令。

pip install --upgrade you-get

如何使用you-get下载视频:

3.1 运行命令提示符,并将当前路径切换到我需要保存视频的文件夹(假定为D:\Temp)下,

1ad94c347e92

打开命令提示符并切到视频文件夹

3.2 打开某个视频网站,这里以youku为例,为了演示特殊情况,我特意挑了个需要密码访问的视频,比如其网址为:https://v.youku.com/v_show/id_123456789==.html

输入命令如下:

you-get -i "https://v.youku.com/v_show/id_123456789==.html"

因为这个视频要密码,所以它会提示Password,输入密码后回车,就会显示如下视频的详细信息:

1ad94c347e92

获取到这个视频各个不同版本的信息

可以看到,这个视频提供了5个版本(红框框定):1080P、超清、高清、渣清(:O)、标清。

对应版本的下载的链接请参考绿框里内容,记得用原始的链接替换里面的[URL]

比如我要下载1080P的版本,那么下载的命令为:

you-get --format=mp4hd3v2 "https://v.youku.com/v_show/id_123456789==.html"

有密码的输密码,没密码的直接就开始下载了,像我的这样:

1ad94c347e92

开始下载了

3.3 某些视频在使用上面3.2步输入命令取得视频信息的时候,可能显示是这样的:

1ad94c347e92

另外的一种情形

这里面并没有像上面的例子那样列出很多的版本等,那么对于这样的,直接用you-get加下载地址就可以了,像下面这样:

you-get "https://v.qq.com/x/page/y3066lqwy31.html"

下面就是下载成功的结果:

1ad94c347e92

下载成功

写到这里,就全面写完了,很简单的吧,可是我找资料的时候着实折腾了一番。

# Get Started ## Installation 1. clone this repo. ``` git clone https://github.com/ShiqiYu/OpenGait.git ``` 2. Install dependenices: - pytorch >= 1.10 - torchvision - pyyaml - tensorboard - opencv-python - tqdm - py7zr - kornia - einops Install dependenices by [Anaconda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html): ``` conda install tqdm pyyaml tensorboard opencv kornia einops -c conda-forge conda install pytorch==1.10 torchvision -c pytorch ``` Or, Install dependenices by pip: ``` pip install tqdm pyyaml tensorboard opencv-python kornia einops pip install torch==1.10 torchvision==0.11 ``` ## Prepare dataset See [prepare dataset](2.prepare_dataset.md). ## Get trained model - Option 1: ``` python misc/download_pretrained_model.py ``` - Option 2: Go to the [release page](https://github.com/ShiqiYu/OpenGait/releases/), then download the model file and uncompress it to [output](output). ## Train Train a model by ``` CUDA_VISIBLE_DEVICES=0,1 python -m torch.distributed.launch --nproc_per_node=2 opengait/main.py --cfgs ./configs/baseline/baseline.yaml --phase train ``` - `python -m torch.distributed.launch` [DDP](https://pytorch.org/tutorials/intermediate/ddp_tutorial.html) launch instruction. - `--nproc_per_node` The number of gpus to use, and it must equal the length of `CUDA_VISIBLE_DEVICES`. - `--cfgs` The path to config file. - `--phase` Specified as `train`. <!-- - `--iter` You can specify a number of iterations or use `restore_hint` in the config file and resume training from there. --> - `--log_to_file` If specified, the terminal log will be written on disk simultaneously. You can run commands in [train.sh](train.sh) for training different models. ## Test Evaluate the trained model by ``` CUDA_VISIBLE_DEVICES=0,1 python -m torch.distributed.launch --nproc_per_node=2 opengait/main.py --cfgs ./configs/baseline/baseline.yaml --phase test ``` - `--phase` Specified as `test`. - `--iter` Specify a iteration checkpoint. **Tip**: Other arguments are the same as train phase. You can run commands in [test.sh](test.sh) for testing different models. ## Customize 1. Read the [detailed config](docs/1.detailed_config.md) to figure out the usage of needed setting items; 2. See [how to create your model](docs/2.how_to_create_your_model.md); 3. There are some advanced usages, refer to [advanced usages](docs/3.advanced_usages.md), please. ## Warning - In `DDP` mode, zombie processes may be generated when the program terminates abnormally. You can use this command [sh misc/clean_process.sh](./misc/clean_process.sh) to clear them.
最新发布
03-18
<think>嗯,用户这次给了一个关于OpenGait的安装和使用指南的文档,然后让我用中文介绍一下或者回答相关问题。看起来用户可能是想部署或者使用这个OpenGait项目,但可能遇到了问题,或者需要更详细的解释。 首先,我需要先仔细阅读用户提供的文档内容,理解每个步骤的作用。用户之前问过关于Conda的错误,可能他现在在尝试安装依赖时遇到了问题,所以需要确保依赖安装正确。也可能他在训练或测试模型时遇到问题,需要帮助。 接下来,用户提供的文档里有几个部分:安装、准备数据集、获取预训练模型、训练、测试、自定义和警告。我需要将这些内容用中文重新组织,确保结构清晰,步骤明确,并且符合用户之前提到的系统级指令,比如数学公式的格式,但这里可能不太涉及数学公式,主要是代码块和命令行指令。 需要注意的是,用户可能对某些步骤不熟悉,比如分布式训练中的DDP模式,或者如何处理僵尸进程。所以解释的时候要尽量简明,但关键点要说清楚。比如在安装依赖时,使用conda和pip两种方式,可能需要提醒用户注意版本兼容性,特别是PyTorch的版本是否与CUDA匹配。 另外,用户之前遇到的Conda错误可能与安装依赖有关,所以在解释安装步骤时,可能需要加入一些注意事项,比如如何避免环境冲突,或者如何正确使用conda-forge频道。同时,用户可能在数据集准备部分需要更多指导,文档里只是提到了一个链接,可能需要补充说明常见的数据集准备步骤或可能遇到的问题。 还有,训练和测试命令中的参数解释需要清楚,比如CUDA_VISIBLE_DEVICES和nproc_per_node的关系,确保用户理解如何根据自己GPU的数量调整参数。自定义部分可能涉及配置文件的理解和模型构建,用户可能需要更多的指引,但文档里已经提供了链接,可能需要强调这些文档的重要性。 后,警告部分提到的僵尸进程问题,用户可能需要知道如何避免或处理这种情况,所以解释清理命令的作用和使用方法是必要的。 总结下来,我需要将用户提供的英文指南转化为结构清晰的中文步骤说明,补充可能需要的注意事项,并确保代码块正确格式化。同时,考虑到用户可能的技术水平,避免使用过于专业的术语,保持解释的易懂性。此外,检查是否有潜在的坑,比如版本冲突、环境配置问题,给出相应的建议,帮助用户顺利完成OpenGait的安装和使用。</think>--- ### **OpenGait 快速入门指南** --- #### **1. 安装步骤** ##### **1.1 克隆代码仓库** ```bash git clone https://github.com/ShiqiYu/OpenGait.git ``` ##### **1.2 安装依赖项** **支持两种安装方式(任选其一):** - **通过 Anaconda 安装(推荐)** 使用 Conda 管理环境可避免依赖冲突: ```bash # 安装基础依赖 conda install tqdm pyyaml tensorboard opencv kornia einops -c conda-forge # 安装 PyTorch 1.10 和对应版本的 torchvision conda install pytorch==1.10 torchvision -c pytorch ``` - **通过 pip 安装** 确保已安装兼容的 Python 环境(建议 Python 3.8+): ```bash pip install tqdm pyyaml tensorboard opencv-python kornia einops pip install torch==1.10 torchvision==0.11 ``` **注意事项:** -使用 GPU,需提前安装与 PyTorch 1.10 匹配的 CUDA 驱动(推荐 CUDA 11.3)。 - 若安装失败,检查网络是否可访问 PyPI 或 Conda 源(国内用户可切换清华镜像)。 --- #### **2. 准备数据集** - 参考文档 [prepare_dataset.md](2.prepare_dataset.md),按指引下载并预处理数据集(如 CASIA-B、OU-MVLP 等)。 - 确保数据集路径与配置文件中的 `dataset_root` 参数一致。 --- #### **3. 获取预训练模型** - **方式一(自动下载)**: ```bash python misc/download_pretrained_model.py ``` - **方式二(手动下载)**: 访问 [Release 页面](https://github.com/ShiqiYu/OpenGait/releases/),下载模型文件后解压到 `output` 目录。 --- #### **4. 模型训练** **单机多卡训练命令示例**: ```bash CUDA_VISIBLE_DEVICES=0,1 python -m torch.distributed.launch --nproc_per_node=2 opengait/main.py --cfgs ./configs/baseline/baseline.yaml --phase train ``` **参数解析**: - `CUDA_VISIBLE_DEVICES=0,1`:指定使用 GPU 0 和 1。 - `--nproc_per_node=2`:每个节点使用 2 个进程(需与 GPU 数量一致)。 - `--cfgs`:配置文件路径(如 `baseline.yaml`)。 - `--phase train`:指定训练模式。 **其他选项**: - 使用 `--log_to_file` 可将日志保存到文件。 - 直接运行 [train.sh](train.sh) 脚本可快速启动不同模型的训练。 --- #### **5. 模型测试** **评估模型性能**: ```bash CUDA_VISIBLE_DEVICES=0,1 python -m torch.distributed.launch --nproc_per_node=2 opengait/main.py --cfgs ./configs/baseline/baseline.yaml --phase test --iter 100000 ``` **关键参数**: - `--phase test`:指定测试模式。 - `--iter 100000`:加载第 10 万次迭代的模型权重。 --- #### **6. 自定义配置与模型** 1. **配置文件详解** 阅读 [detailed_config.md](docs/1.detailed_config.md) 了解如何调整超参数(如学习率、数据集路径等)。 2. **自定义模型** 参考 [how_to_create_your_model.md](docs/2.how_to_create_your_model.md) 添加新网络结构。 3. **高级功能** 如多机训练、混合精度训练等,详见 [advanced_usages.md](docs/3.advanced_usages.md)。 --- #### **7. 常见问题与警告** - **僵尸进程清理** 若训练异常终止导致进程残留,运行以下命令清理: ```bash sh misc/clean_process.sh ``` - **DDP 模式兼容性** 确保 PyTorch 版本与 CUDA 驱动匹配,避免分布式训练失败。 --- ### **操作验证** - **依赖安装检查** 运行 `python -c "import torch; print(torch.__version__)"` 应输出 `1.10.x`。 - **训练启动验证** 执行训练命令后,检查终端是否正常输出损失值和进度条。 --- ### **扩展支持** - 若遇到环境配置问题,可尝试使用 Docker 镜像(需自行构建)。 - 详细文档参考 [OpenGait Wiki](https://github.com/ShiqiYu/OpenGait/wiki)。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值