Skip to content

Conversation

@Alisonka
Copy link
Collaborator

@Alisonka Alisonka commented May 3, 2024

No description provided.

@Alisonka
Copy link
Collaborator Author

Alisonka commented May 3, 2024

Create a new llava_captioning filter

@@ -0,0 +1,114 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

этот файл лишний

Comment on lines 68 to 76
resized_width = self.resize if width <= height else self.resize * width // height
resized_height = self.resize * height // width if width <= height else self.resize
resized_img = pil_img.resize((resized_width, resized_height))
width, height = resized_img.size
left = (width - self.crop_size_x) // 2
top = (height - self.crop_size_y) // 2
right = left + self.crop_size_x
bottom = top + self.crop_size_y
cropped_image = resized_img.crop((left, top, right, bottom))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это заменяется таким трансформом:
transform = T.Compose([
T.Resize(min_size),
T.CenterCrop(min_size)
])

self.crop_size_y = crop_size_y
self.resize = resize
self.model_path = model_path
self.prompt = "<|im_start|>system\nAnswer the questions.<|im_end|><|im_start|>user\n<image>\nDescribe this image and its style in a very detailed manner<|im_end|><|im_start|>assistant\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут только один промпт и он захардкожен в код( Нужно сделать, чтобы его можно было менять. Посмотри как реализовано в ллаве 1.5

@boomb0om boomb0om merged commit 8eae802 into dev Jun 10, 2024
@Alisonka Alisonka deleted the dev_alisa branch June 10, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants