TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #76 · 27 апр.

Ранее я делал серию постов про битовые операторы. Вот вам ещё один наглядный пример как это используется в Python в модуле re. Чтобы указать флаг для компилятора нам надо указать его после передаваемой строки. Например, добавляем флаг для игнорирования переноса строки. pattern = re.compile(r"(\w+)+") words = pattern.search(text, re.DOTALL) А как указать несколько флагов? Ведь явно будут ситуации когда нам потребуется больше одного. Кто читал посты по битовые операторы уже понял как. pattern.search(text, re.DOTALL | re.VERBOSE) А теперь смотрим исходники, что находится в этих атрибутах? Не удивительно, степени двойки. Почему? Потому что каждое следующее значение это сдвиг единицы влево. >>> for n in [1, 2, 4, 8, 16, 32, 64, 128, 256]: >>> print(bin(n)) 0b1 0b10 0b100 0b1000 0b10000 0b100000 0b1000000 0b10000000 0b100000000 Чтобы было понятней, давайте напишем тоже самое но иначе, добавим ведущие нули: 000000001 000000010 000000100 000001000 000010000 000100000 001000000 010000000 100000000 Не понятно что тут происходит? Читай три поста про битовые операторы начиная с этого ➡️https://t.me/pythonotes/45 В общем, это пример применения побитовых операций в самом Python. Теперь вы знаете Python еще немного лучше) #tricks#regex#libs

Резултати

Пронајдени 1 слични објави

Пребарај: #f0f0f0

当前筛选 #f0f0f0清除筛选

Я тут планирую добавить редактор персонажей в будущих обновлениях Banana-Crunch. Он пригодится тебе, если работаешь со сценами или персонажами. Хочу сделать всё максимально просто, чтобы буквально в пару кликов можно было получить нужный результат: позы, эмоции, ракурсы, взаимодействия и примеры. А пока делюсь частью инструкций и промптов, которые ты уже можешь использовать в работе. Подготовка к модельному ракурсу: You are an expert fashion photographer AI. Transform the person in this image into a full-body fashion model photo suitable for an e-commerce website. The background must be a clean, neutral studio backdrop (light gray, #f0f0f0). The person should have a neutral, professional model expression. Preserve the person's identity, unique features, and body type, but place them in a standard, relaxed standing model pose. The final image must be photorealistic. Return ONLY the final image. Важно! Выстави значение Ratio 9x16 Примерка одежды: You are an expert virtual try-on AI. You will be given a 'model image' and a 'garment image'. Your task is to create a new photorealistic image where the person from the 'model image' is wearing the clothing from the 'garment image'. Crucial Rules: 1. Complete Garment Replacement: You MUST completely REMOVE and REPLACE the clothing item worn by the person in the 'model image' with the new garment. No part of the original clothing (e.g., collars, sleeves, patterns) should be visible in the final image. 2. Preserve the Model: The person's face, hair, body shape, and pose from the 'model image' MUST remain unchanged. 3. Preserve the Background: The entire background from the 'model image' MUST be preserved perfectly. 4. Apply the Garment: Realistically fit the new garment onto the person. It should adapt to their pose with natural folds, shadows, and lighting consistent with the original scene. 5. Output: Return ONLY the final, edited image. Do not include any text. Важно! Сначала шмотка потом персонаж/модель Инструкция для позы: You are an expert fashion photographer AI. Take this image and regenerate it from a different perspective. The person, clothing, and background style must remain identical. The new perspective should be: "Jumping in the air, mid-action shot" [тут позу сам меняешь]. Return ONLY the final image. 😣 Хотел промпты получай! Жду тут твои реакции и коменты, а главное репосты ! #prompts | AcidCrunch