mirror of
https://github.com/yunjey/pytorch-tutorial.git
synced 2025-07-30 21:56:14 +08:00
Create README.md
This commit is contained in:
42
tutorials/09 - Image Captioning/README.md
Normal file
42
tutorials/09 - Image Captioning/README.md
Normal file
@ -0,0 +1,42 @@
|
||||
## Usage
|
||||
|
||||
|
||||
#### 1. Clone the repositories
|
||||
```bash
|
||||
$ git clone https://github.com/pdollar/coco.git
|
||||
$ git clone https://github.com/yunjey/pytorch-tutorial.git
|
||||
$ cd pytorch-tutorial/tutorials/09 - Image Captioning
|
||||
```
|
||||
|
||||
#### 2. Download the dataset
|
||||
|
||||
```bash
|
||||
$ pip install -r requirements
|
||||
$ chmod +x download.sh
|
||||
$ ./donwload.sh
|
||||
```
|
||||
|
||||
#### 3. Preprocessing
|
||||
|
||||
```bash
|
||||
$ python vocab.py
|
||||
```
|
||||
|
||||
#### 4. Train the model
|
||||
|
||||
```bash
|
||||
$ python train.py
|
||||
```
|
||||
|
||||
#### 5. Generate captions
|
||||
If you want to generate captions from MSCOCO validation dataset, see [evaluate_model.ipynb](https://github.com/yunjey/pytorch-tutorial/blob/master/tutorials/09%20-%20Image%20Captioning/evaluate_model.ipynb). Otherwise, if you want to generate captions from custom image file, run command as below.
|
||||
|
||||
```bash
|
||||
$ python sample.py --image=sample_image.jpg
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
## Pretrained model
|
||||
|
||||
If you do not want to train the model yourself, you can use a pretrained model. I have provided the pretrained model as a zip file. You can download the file [here](https://www.dropbox.com/s/cngzozkk73imjdh/trained_model.zip?dl=0) and extract it to `model` directory.
|
Reference in New Issue
Block a user