John6666 commited on
Commit
ad32eb7
·
verified ·
1 Parent(s): ef9cfeb

Upload 3 files

Browse files
Files changed (1) hide show
  1. scripts/README.md +22 -17
scripts/README.md CHANGED
@@ -14,23 +14,24 @@ This command will caption all the `.jpg` images in the specified directory using
14
 
15
  ## Command-Line Arguments
16
 
17
- **Note**: You must specify either `--glob` or `--filelist` to provide images, and either `--prompt` or `--prompt-file` to provide a prompt for caption generation.
18
-
19
- | Argument | Description | Default |
20
- | ------------------ | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
21
- | `--glob` | Glob pattern to find images | N/A |
22
- | `--filelist` | File containing a list of images | N/A |
23
- | `--prompt` | Prompt to use for caption generation | N/A |
24
- | `--prompt-file` | JSON file containing prompts | N/A |
25
- | `--batch-size` | Batch size for image processing | 1 |
26
- | `--greedy` | Use greedy decoding instead of sampling | False |
27
- | `--temperature` | Sampling temperature (used when not using greedy decoding) | 0.6 |
28
- | `--top-p` | Top-p sampling value (nucleus sampling) | 0.9 |
29
- | `--top-k` | Top-k sampling value | None |
30
- | `--max-new-tokens` | Maximum length of the generated caption (in tokens) | 256 |
31
- | `--num-workers` | Number of workers loading images in parallel | 4 |
32
- | `--model` | Pre-trained model to use | [fancyfeast/llama-joycaption-alpha-two-hf-llava](https://huggingface.co/fancyfeast/llama-joycaption-alpha-two-hf-llava) |
33
-
 
34
 
35
 
36
  ### Examples
@@ -40,6 +41,10 @@ This command will caption all the `.jpg` images in the specified directory using
40
  ```sh
41
  ./batch-caption.py --glob "images/*.png" --prompt "Write a descriptive caption for this image in a formal tone."
42
  ```
 
 
 
 
43
 
44
  2. **Use a JSON file for prompts**
45
 
 
14
 
15
  ## Command-Line Arguments
16
 
17
+ **Note**: You must specify either `--glob` or `--filelist` or `--input` to provide images, and either `--prompt` or `--prompt-file` to provide a prompt for caption generation.
18
+
19
+ | Argument | Description | Default |
20
+ | ------------------ | ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
21
+ | `--input` | Input images | N/A |
22
+ | `--glob` | Glob pattern to find images | N/A |
23
+ | `--filelist` | File containing a list of images | N/A |
24
+ | `--prompt` | Prompt to use for caption generation | N/A |
25
+ | `--prompt-file` | JSON file containing prompts | N/A |
26
+ | `--batch-size` | Batch size for image processing | 1 |
27
+ | `--greedy` | Use greedy decoding instead of sampling | False |
28
+ | `--temperature` | Sampling temperature (used when not using greedy decoding) | 0.6 |
29
+ | `--top-p` | Top-p sampling value (nucleus sampling) | 0.9 |
30
+ | `--top-k` | Top-k sampling value | None |
31
+ | `--max-new-tokens` | Maximum length of the generated caption (in tokens) | 256 |
32
+ | `--num-workers` | Number of workers loading images in parallel | 4 |
33
+ | `--model` | Pre-trained model to use | [John6666/llama-joycaption-alpha-two-hf-llava-nf4](https://huggingface.co/John6666/llama-joycaption-alpha-two-hf-llava-nf4) |
34
+ | `--bf16` | Load model on torch.bfloat16 | False |
35
 
36
 
37
  ### Examples
 
41
  ```sh
42
  ./batch-caption.py --glob "images/*.png" --prompt "Write a descriptive caption for this image in a formal tone."
43
  ```
44
+ or
45
+ ```sh
46
+ ./batch-caption.py --input "images/dog.png" --prompt "Write a descriptive caption for this image in a formal tone."
47
+ ```
48
 
49
  2. **Use a JSON file for prompts**
50