from utils import llama32, stream_response, disp_image, img2base64
from utils import llama32pi, rs4llama, merge_images, llama32opi, ocr_reprompt, ollamapi, inollama
from fastcore.all import *
import pathlib
import PIL
= "images/fridge-3.jpg" img_loc
disp_image(img_loc)
= ("What're in the fridge? What kind of food can be made? Give me 2 examples, based on only the ingredients in the fridge"); question question
"What're in the fridge? What kind of food can be made? Give me 2 examples, based on only the ingredients in the fridge"
= llama32pi(question, image_url=img_loc); result result
<<Streaming response>>
There is a wide range of food available in this refrigerator, which enables various meal options.
Two possible dishes that can be prepared are:
- A simple salad consisting of tomatoes and apples.
- Grilled asparagus and watermelon with fruit juice.
The above examples are based only on the ingredients present in the fridge.
'There is a wide range of food available in this refrigerator, which enables various meal options.\n\nTwo possible dishes that can be prepared are:\n\n1. A simple salad consisting of tomatoes and apples.\n2. Grilled asparagus and watermelon with fruit juice. \n\nThe above examples are based only on the ingredients present in the fridge.'
= ollamapi(question, image_url=img_loc, model='llava:13b'); result2 result2
<<Streaming response>>
The image shows a refrigerator with various items inside. From what is visible, it appears to be stocked with a variety of ingredients suitable for cooking. Here are two example dishes that could be made using the available ingredients (assuming they’re still fresh and unexpired):
Stir-Fry: You can make a stir-fry with some of the vegetables such as carrots, broccoli, or bell peppers, combined with any protein source like chicken or tofu. Add any available grains (like rice or noodles) and cook it all together in a pan or wok with some oil.
Pasta Salad: If there’s pasta among the items inside, you could make a pasta salad by boiling the pasta and combining it with a variety of vegetables (like tomatoes, cucumbers, onions), if available, and possibly some protein such as chicken or shrimp. Add some dressing (if there is one) to your liking and serve cold for a refreshing meal.
" The image shows a refrigerator with various items inside. From what is visible, it appears to be stocked with a variety of ingredients suitable for cooking. Here are two example dishes that could be made using the available ingredients (assuming they're still fresh and unexpired):\n\n1. **Stir-Fry**: You can make a stir-fry with some of the vegetables such as carrots, broccoli, or bell peppers, combined with any protein source like chicken or tofu. Add any available grains (like rice or noodles) and cook it all together in a pan or wok with some oil.\n\n2. **Pasta Salad**: If there's pasta among the items inside, you could make a pasta salad by boiling the pasta and combining it with a variety of vegetables (like tomatoes, cucumbers, onions), if available, and possibly some protein such as chicken or shrimp. Add some dressing (if there is one) to your liking and serve cold for a refreshing meal."
= ollamapi(question, image_url=img_loc, model='minicpm-v:latest'); result3 result3
<<Streaming response>>
Based on the items visible inside the refrigerator, one could make a fresh vegetable salad and possibly a tuna or chicken wrap.
For example: 1. Vegetable Salad: Using the leafy greens such as lettuce and arugula from the bottom shelf, along with cherry tomatoes, cucumber slices, celery sticks (if there are any), you can create a refreshing vegetable salad. Dress it up with some olive oil, vinegar or your favorite dressing.
- Tuna Wrap: If there is canned tuna in the top shelves, you could combine it with sliced avocado and perhaps add a layer of pesto sauce from one of the containers (if available). Place these ingredients between two wraps to create a healthy wrap that’s perfect for lunch on-the-go or as a quick snack.
These are just examples based on what appears to be in the refrigerator. You might find other items not visible here, which could expand your culinary possibilities significantly!
"Based on the items visible inside the refrigerator, one could make a fresh vegetable salad and possibly a tuna or chicken wrap. \n\nFor example:\n1. **Vegetable Salad**: Using the leafy greens such as lettuce and arugula from the bottom shelf, along with cherry tomatoes, cucumber slices, celery sticks (if there are any), you can create a refreshing vegetable salad. Dress it up with some olive oil, vinegar or your favorite dressing.\n\n2. **Tuna Wrap**: If there is canned tuna in the top shelves, you could combine it with sliced avocado and perhaps add a layer of pesto sauce from one of the containers (if available). Place these ingredients between two wraps to create a healthy wrap that's perfect for lunch on-the-go or as a quick snack.\n\nThese are just examples based on what appears to be in the refrigerator. You might find other items not visible here, which could expand your culinary possibilities significantly!"
= "is there banana in the fridge? where?"
new_question
= [
messages "role": "user", "content": [
{"type": "text", "text": question},
{"type": "image_url", "image_url": {"url": img_loc}}
{
]}, "role": "assistant", "content": result3},
{"role": "user", "content": new_question}
{; messages
]
= {'temperature': 0.0, 'max_tokens': 4096}
options ='minicpm-v:latest'
model= stream_response(inollama(messages, options=options, model=model, stream=True)) result4
<<Streaming response>>
print(result4)
No, there is no banana present in the fridge as per my analysis of the image provided. The shelves contain various fruits such as apples and tomatoes but a banana isn't one of them. Please note that if the bananas are located on an upper or lower shelf not visible from this angle, it's possible they could be stored outside our current view.
= "is there apple in the fridge? where?"
new_question
= [
messages "role": "user", "content": [
{"type": "text", "text": question},
{"type": "image_url", "image_url": {"url": img_loc}}
{
]}, "role": "assistant", "content": result3},
{"role": "user", "content": new_question}
{; messages
]
= {'temperature': 0.0, 'max_tokens': 4096}
options ='minicpm-v:latest'
model= stream_response(inollama(messages, options=options, model=model, stream=True)) result4
<<Streaming response>>
Yes, there is an apple in the fridge. It’s located in one of the lower drawers or compartments on the right side, alongside some red apples. This drawer seems to be dedicated for fruits and vegetables. The exact placement within that section isn’t entirely clear from this angle but it’s definitely among other produce items like tomatoes which are also visible nearby.
= "is there apple in the fridge? where?"
new_question
= [
messages "role": "user", "content": [
{"type": "text", "text": question},
{"type": "image_url", "image_url": {"url": img_loc}}
{
]}, "role": "assistant", "content": result3},
{"role": "user", "content": new_question}
{; messages
]
= {'temperature': 0.0, 'max_tokens': 4096}
options ='llava:13b'
model= stream_response(inollama(messages, options=options, model=model, stream=True)) result4
<<Streaming response>>
Yes, there is a red apple in the bottom left corner of the open refrigerator.
= "is there apple in the fridge? where?"
new_question
= [
messages "role": "user", "content": [
{"type": "text", "text": question},
{"type": "image_url", "image_url": {"url": img_loc}}
{
]}, "role": "assistant", "content": result3},
{"role": "user", "content": new_question}
{; messages
]
= {'temperature': 0.0, 'max_tokens': 4096}
options ='llama3.2-vision:11b'
model= stream_response(inollama(messages, options=options, model=model, stream=True)) result4
<<Streaming response>>
There appear to be apples in the bottom right corner of the photo, contained within a plastic container.
You can see some red and green apples, probably Red Delicious or Granny Smith, although it’s difficult to tell for certain without more information about this specific set of fruits.
The apples are stored in the fridge at the bottom, possibly in the crisper drawer which is usually reserved for fruit and vegetables that require a bit of extra moisture.
= "is there chilli in the fridge? where?"
new_question
= [
messages "role": "user", "content": [
{"type": "text", "text": question},
{"type": "image_url", "image_url": {"url": img_loc}}
{
]}, "role": "assistant", "content": result3},
{"role": "user", "content": new_question}
{; messages
]
= {'temperature': 0.0, 'max_tokens': 4096}
options ='llama3.2-vision:11b'
model= stream_response(inollama(messages, options=options, model=model, stream=True)) result4
<<Streaming response>>
There is no chili visible within the fridge. However, it’s possible that you might have missed a small jar of chili tucked away somewhere among the numerous containers and cans. Without being able to see the interior of each container, I can’t be certain whether there is any chili in there or not.
However, assuming that the shelves are properly stocked, here are some potential locations for chili:
- Top shelf: Check under the yogurt and juice boxes.
- Middle shelf: Look between the canned goods and the condiments.
- Bottom shelf: Inspect the back of the bottom shelf, where it meets the door.
If you don’t find any chili in these areas, you might need to search other parts of your kitchen or pantry.
= "is there chicken in the fridge? where?"
new_question
= [
messages "role": "user", "content": [
{"type": "text", "text": question},
{"type": "image_url", "image_url": {"url": img_loc}}
{
]}, "role": "assistant", "content": result3},
{"role": "user", "content": new_question}
{; messages
]
= {'temperature': 0.0, 'max_tokens': 4096}
options ='llava:13b'
model= stream_response(inollama(messages, options=options, model=model, stream=True)) result4
<<Streaming response>>
The image shows a variety of food items inside the refrigerator, but I can’t definitively confirm if there is chicken. If there is, it might be hidden behind other items or stored on a different shelf. However, given that chicken breast is a common protein item found in many refrigerators and would likely be found on one of the middle or top shelves. Without a more detailed view or specific information about what’s inside, I can only speculate based on general food storage practices.