1 Star 5 Fork 1

cubone/learnopencv

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Setup

Before installation create and activate virtual environment

python3 -m venv venv
source venv/bin/activate

Install the dependencies

pip install -r requirements.txt

Training

For training run jupyter notebook

Additional instructions

Data preparation

We use the NUS-WIDE dataset for this tutorial. Instead of parsing Flickr for image downloading we use a dump from this github repository Download and extract it.

Also, we added pre-processed annotations:
nus_wide/train.json
nus_wide/test.json

If you want to create them yourself, run the command:

python split_data_nus.py -i images

where -i images is the path to the folder with extracted images

Subset creation

You can train the model for the entire data set, but it takes a lot of time. For this tutorial we use part of this data.

For subset creation run the command:

python create_subset.py -i images

where -i images is the path to the folder with extracted images

Additional options:

python create_subset.py -h
usage: Subset creation [-h] -i IMG_PATH [-v VAL_SIZE] [-t TRAIN_SIZE]
                       [--shuffle] [-l LABELS [LABELS ...]]

optional arguments:
  -h, --help            show this help message and exit
  -i IMG_PATH, --img-path IMG_PATH
                        Path to the "images" folder
  -v VAL_SIZE, --val-size VAL_SIZE
                        Size of the validation data
  -t TRAIN_SIZE, --train-size TRAIN_SIZE
                        Size of the train data
  --shuffle             Shuffle samples before splitting
  -l LABELS [LABELS ...], --labels LABELS [LABELS ...]
                        Subset labels
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cubone/learnopencv.git
git@gitee.com:cubone/learnopencv.git
cubone
learnopencv
learnopencv
master

搜索帮助