From c6839812791f91d684060952b4dbd59565b1ccb7 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Wed, 9 Jul 2025 11:49:04 -0700 Subject: [PATCH] Improve prompt when no people are present --- extract_tags.rb | 12 +++++++----- .../llava-7b/768/01-structured-comprehensive.csv | 2 ++ .../llava-7b/768/03-single-list.csv | 2 ++ .../llava-7b/768/05-detailed-elements.csv | 2 ++ .../llava-7b/768/run.json | 10 ++++++++++ results-mini-test-16-highland-cattle/master.csv | 10 ++++++++++ .../minicpm-v-8b/768/01-structured-comprehensive.csv | 2 ++ .../minicpm-v-8b/768/03-single-list.csv | 2 ++ .../minicpm-v-8b/768/05-detailed-elements.csv | 2 ++ .../minicpm-v-8b/768/run.json | 10 ++++++++++ .../qwen2.5vl-7b/768/01-structured-comprehensive.csv | 2 ++ .../qwen2.5vl-7b/768/03-single-list.csv | 2 ++ .../qwen2.5vl-7b/768/05-detailed-elements.csv | 2 ++ .../qwen2.5vl-7b/768/run.json | 10 ++++++++++ 14 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 results-mini-test-16-highland-cattle/llava-7b/768/01-structured-comprehensive.csv create mode 100644 results-mini-test-16-highland-cattle/llava-7b/768/03-single-list.csv create mode 100644 results-mini-test-16-highland-cattle/llava-7b/768/05-detailed-elements.csv create mode 100644 results-mini-test-16-highland-cattle/llava-7b/768/run.json create mode 100644 results-mini-test-16-highland-cattle/master.csv create mode 100644 results-mini-test-16-highland-cattle/minicpm-v-8b/768/01-structured-comprehensive.csv create mode 100644 results-mini-test-16-highland-cattle/minicpm-v-8b/768/03-single-list.csv create mode 100644 results-mini-test-16-highland-cattle/minicpm-v-8b/768/05-detailed-elements.csv create mode 100644 results-mini-test-16-highland-cattle/minicpm-v-8b/768/run.json create mode 100644 results-mini-test-16-highland-cattle/qwen2.5vl-7b/768/01-structured-comprehensive.csv create mode 100644 results-mini-test-16-highland-cattle/qwen2.5vl-7b/768/03-single-list.csv create mode 100644 results-mini-test-16-highland-cattle/qwen2.5vl-7b/768/05-detailed-elements.csv create mode 100644 results-mini-test-16-highland-cattle/qwen2.5vl-7b/768/run.json diff --git a/extract_tags.rb b/extract_tags.rb index 408b133..66c8df4 100755 --- a/extract_tags.rb +++ b/extract_tags.rb @@ -19,11 +19,13 @@ class TagExtractor DEFAULT_SYSTEM_PROMPT = <<~PROMPT.freeze You are an image-keyword assistant. After analyzing each picture, output one line containing concise, lowercase English keywords separated by commas. Focus on people's emotions, expressions, moods, and - activities if present. Include overall atmosphere, key objects, dominant colors, lighting quality, - and setting. For people: include 'people' if humans are visible, with descriptors like 'couple', - 'group', or 'crowd'. If the image appears to be a selfie or POV (point-of-view/first-person perspective), - include 'selfie' or 'pov' as appropriate. Prioritize emotional and mood keywords. Do not repeat synonyms. - Do not output anything except the comma-separated keyword list. + activities, if present. When no people are present then ignore that aspect and focus on the rest of the + scene. Include overall atmosphere, key objects, dominant colors, lighting quality, and setting. + When there are people then you can include descriptors like 'couple', 'group', 'crowd', 'solo', 'alone', + etc. When the image appears to be a selfie or POV (point-of-view/first-person perspective), + include 'selfie' or 'pov' as appropriate but don't guess, just omit if unsure. Prioritize emotional and + mood keywords. Do not repeat synonyms. DO NOT OUTPUT ANYTHING EXCEPT THE COMMA-SEPARATED LIST. DON'T + REPEAT KEYWORDS OR THEMES EXCESSIVELY. PROMPT def initialize(options = {}) diff --git a/results-mini-test-16-highland-cattle/llava-7b/768/01-structured-comprehensive.csv b/results-mini-test-16-highland-cattle/llava-7b/768/01-structured-comprehensive.csv new file mode 100644 index 0000000..62c3407 --- /dev/null +++ b/results-mini-test-16-highland-cattle/llava-7b/768/01-structured-comprehensive.csv @@ -0,0 +1,2 @@ +image_filename,tags,raw_output,timestamp,success +16-highland-cattle-pen.jpg,"brown dirt, calm, cows, fence, field, green grass, horns, long hair, pastoral"," cows, long hair, horns, field, green grass, brown dirt, fence, calm, pastoral ",2025-07-08T09:33:26-07:00,true diff --git a/results-mini-test-16-highland-cattle/llava-7b/768/03-single-list.csv b/results-mini-test-16-highland-cattle/llava-7b/768/03-single-list.csv new file mode 100644 index 0000000..a675b1e --- /dev/null +++ b/results-mini-test-16-highland-cattle/llava-7b/768/03-single-list.csv @@ -0,0 +1,2 @@ +image_filename,tags,raw_output,timestamp,success +16-highland-cattle-pen.jpg,"animals, cows, field, grass, green"," cows, field, green, grass, animals ",2025-07-08T09:33:26-07:00,true diff --git a/results-mini-test-16-highland-cattle/llava-7b/768/05-detailed-elements.csv b/results-mini-test-16-highland-cattle/llava-7b/768/05-detailed-elements.csv new file mode 100644 index 0000000..cfcf30c --- /dev/null +++ b/results-mini-test-16-highland-cattle/llava-7b/768/05-detailed-elements.csv @@ -0,0 +1,2 @@ +image_filename,tags,raw_output,timestamp,success +16-highland-cattle-pen.jpg,"animals, cows, field, grass, green, pasture"," cows, field, green, grass, animals, pasture ",2025-07-08T09:33:26-07:00,true diff --git a/results-mini-test-16-highland-cattle/llava-7b/768/run.json b/results-mini-test-16-highland-cattle/llava-7b/768/run.json new file mode 100644 index 0000000..1a5ff7b --- /dev/null +++ b/results-mini-test-16-highland-cattle/llava-7b/768/run.json @@ -0,0 +1,10 @@ +{ + "model": "llava:7b", + "image_size": 768, + "prompt_name": "05-detailed-elements", + "timestamp": "2025-07-08T09:33:26-07:00", + "system": { + "platform": "arm64-darwin24", + "ruby_version": "3.4.3" + } +} \ No newline at end of file diff --git a/results-mini-test-16-highland-cattle/master.csv b/results-mini-test-16-highland-cattle/master.csv new file mode 100644 index 0000000..1050c7b --- /dev/null +++ b/results-mini-test-16-highland-cattle/master.csv @@ -0,0 +1,10 @@ +model,image_size,prompt_name,image_filename,tags,raw_output,timestamp,success +llava:7b,768,01-structured-comprehensive,16-highland-cattle-pen.jpg,"brown dirt, calm, cows, fence, field, green grass, horns, long hair, pastoral"," cows, long hair, horns, field, green grass, brown dirt, fence, calm, pastoral ",2025-07-08T09:33:26-07:00,true +llava:7b,768,03-single-list,16-highland-cattle-pen.jpg,"animals, cows, field, grass, green"," cows, field, green, grass, animals ",2025-07-08T09:33:26-07:00,true +llava:7b,768,05-detailed-elements,16-highland-cattle-pen.jpg,"animals, cows, field, grass, green, pasture"," cows, field, green, grass, animals, pasture ",2025-07-08T09:33:26-07:00,true +qwen2.5vl:7b,768,01-structured-comprehensive,16-highland-cattle-pen.jpg,"brown, calm, cows, daytime, earthy, grazing, ground, natural, outdoor, relaxed, rural, white","cows, relaxed, grazing, ground, natural, earthy, brown, white, rural, calm, daytime, outdoor",2025-07-08T09:33:33-07:00,true +qwen2.5vl:7b,768,03-single-list,16-highland-cattle-pen.jpg,"brown, calm, cattle, daytime, dry, earthy, fence, grazing, horns, natural, outdoor, rural","cattle, rural, earthy, dry, fence, grazing, calm, natural, outdoor, daytime, brown, horns",2025-07-08T09:33:34-07:00,true +qwen2.5vl:7b,768,05-detailed-elements,16-highland-cattle-pen.jpg,"brown, calm, dirt, farm, grazing, horns, peaceful, rural, sunny","calm, grazing, rural, brown, dirt, sunny, farm, peaceful, horns",2025-07-08T09:33:34-07:00,true +minicpm-v:8b,768,01-structured-comprehensive,16-highland-cattle-pen.jpg,"animals, brown fur, calm demeanor, daylight, hay bales, highland cattle, natural light, no people present, outdoor scene, overhead shot, pastoral landscape., peaceful, rural farm environment, standing on dirt ground","no people present, animals, brown fur, standing on dirt ground, hay bales, overhead shot, rural farm environment, daylight, natural light, outdoor scene, highland cattle, calm demeanor, peaceful, pastoral landscape.",2025-07-08T09:33:53-07:00,true +minicpm-v:8b,768,03-single-list,16-highland-cattle-pen.jpg,"brown fur, dirt ground, hay bales, highland cattle, horns, overhead view","highland cattle, brown fur, horns, dirt ground, hay bales, overhead view",2025-07-08T09:33:53-07:00,true +minicpm-v:8b,768,05-detailed-elements,16-highland-cattle-pen.jpg,"brown fur, dirt ground, hay bales, highland cattle, horns, overhead view","highland cattle, brown fur, horns, dirt ground, hay bales, overhead view",2025-07-08T09:33:54-07:00,true diff --git a/results-mini-test-16-highland-cattle/minicpm-v-8b/768/01-structured-comprehensive.csv b/results-mini-test-16-highland-cattle/minicpm-v-8b/768/01-structured-comprehensive.csv new file mode 100644 index 0000000..f9fcc56 --- /dev/null +++ b/results-mini-test-16-highland-cattle/minicpm-v-8b/768/01-structured-comprehensive.csv @@ -0,0 +1,2 @@ +image_filename,tags,raw_output,timestamp,success +16-highland-cattle-pen.jpg,"animals, brown fur, calm demeanor, daylight, hay bales, highland cattle, natural light, no people present, outdoor scene, overhead shot, pastoral landscape., peaceful, rural farm environment, standing on dirt ground","no people present, animals, brown fur, standing on dirt ground, hay bales, overhead shot, rural farm environment, daylight, natural light, outdoor scene, highland cattle, calm demeanor, peaceful, pastoral landscape.",2025-07-08T09:33:53-07:00,true diff --git a/results-mini-test-16-highland-cattle/minicpm-v-8b/768/03-single-list.csv b/results-mini-test-16-highland-cattle/minicpm-v-8b/768/03-single-list.csv new file mode 100644 index 0000000..1f7c64c --- /dev/null +++ b/results-mini-test-16-highland-cattle/minicpm-v-8b/768/03-single-list.csv @@ -0,0 +1,2 @@ +image_filename,tags,raw_output,timestamp,success +16-highland-cattle-pen.jpg,"brown fur, dirt ground, hay bales, highland cattle, horns, overhead view","highland cattle, brown fur, horns, dirt ground, hay bales, overhead view",2025-07-08T09:33:53-07:00,true diff --git a/results-mini-test-16-highland-cattle/minicpm-v-8b/768/05-detailed-elements.csv b/results-mini-test-16-highland-cattle/minicpm-v-8b/768/05-detailed-elements.csv new file mode 100644 index 0000000..4b8603a --- /dev/null +++ b/results-mini-test-16-highland-cattle/minicpm-v-8b/768/05-detailed-elements.csv @@ -0,0 +1,2 @@ +image_filename,tags,raw_output,timestamp,success +16-highland-cattle-pen.jpg,"brown fur, dirt ground, hay bales, highland cattle, horns, overhead view","highland cattle, brown fur, horns, dirt ground, hay bales, overhead view",2025-07-08T09:33:54-07:00,true diff --git a/results-mini-test-16-highland-cattle/minicpm-v-8b/768/run.json b/results-mini-test-16-highland-cattle/minicpm-v-8b/768/run.json new file mode 100644 index 0000000..f52cf0c --- /dev/null +++ b/results-mini-test-16-highland-cattle/minicpm-v-8b/768/run.json @@ -0,0 +1,10 @@ +{ + "model": "minicpm-v:8b", + "image_size": 768, + "prompt_name": "05-detailed-elements", + "timestamp": "2025-07-08T09:33:54-07:00", + "system": { + "platform": "arm64-darwin24", + "ruby_version": "3.4.3" + } +} \ No newline at end of file diff --git a/results-mini-test-16-highland-cattle/qwen2.5vl-7b/768/01-structured-comprehensive.csv b/results-mini-test-16-highland-cattle/qwen2.5vl-7b/768/01-structured-comprehensive.csv new file mode 100644 index 0000000..151edf3 --- /dev/null +++ b/results-mini-test-16-highland-cattle/qwen2.5vl-7b/768/01-structured-comprehensive.csv @@ -0,0 +1,2 @@ +image_filename,tags,raw_output,timestamp,success +16-highland-cattle-pen.jpg,"brown, calm, cows, daytime, earthy, grazing, ground, natural, outdoor, relaxed, rural, white","cows, relaxed, grazing, ground, natural, earthy, brown, white, rural, calm, daytime, outdoor",2025-07-08T09:33:33-07:00,true diff --git a/results-mini-test-16-highland-cattle/qwen2.5vl-7b/768/03-single-list.csv b/results-mini-test-16-highland-cattle/qwen2.5vl-7b/768/03-single-list.csv new file mode 100644 index 0000000..813aba6 --- /dev/null +++ b/results-mini-test-16-highland-cattle/qwen2.5vl-7b/768/03-single-list.csv @@ -0,0 +1,2 @@ +image_filename,tags,raw_output,timestamp,success +16-highland-cattle-pen.jpg,"brown, calm, cattle, daytime, dry, earthy, fence, grazing, horns, natural, outdoor, rural","cattle, rural, earthy, dry, fence, grazing, calm, natural, outdoor, daytime, brown, horns",2025-07-08T09:33:34-07:00,true diff --git a/results-mini-test-16-highland-cattle/qwen2.5vl-7b/768/05-detailed-elements.csv b/results-mini-test-16-highland-cattle/qwen2.5vl-7b/768/05-detailed-elements.csv new file mode 100644 index 0000000..0276297 --- /dev/null +++ b/results-mini-test-16-highland-cattle/qwen2.5vl-7b/768/05-detailed-elements.csv @@ -0,0 +1,2 @@ +image_filename,tags,raw_output,timestamp,success +16-highland-cattle-pen.jpg,"brown, calm, dirt, farm, grazing, horns, peaceful, rural, sunny","calm, grazing, rural, brown, dirt, sunny, farm, peaceful, horns",2025-07-08T09:33:34-07:00,true diff --git a/results-mini-test-16-highland-cattle/qwen2.5vl-7b/768/run.json b/results-mini-test-16-highland-cattle/qwen2.5vl-7b/768/run.json new file mode 100644 index 0000000..b3d8c34 --- /dev/null +++ b/results-mini-test-16-highland-cattle/qwen2.5vl-7b/768/run.json @@ -0,0 +1,10 @@ +{ + "model": "qwen2.5vl:7b", + "image_size": 768, + "prompt_name": "05-detailed-elements", + "timestamp": "2025-07-08T09:33:34-07:00", + "system": { + "platform": "arm64-darwin24", + "ruby_version": "3.4.3" + } +} \ No newline at end of file