وظیفه MediaPipe Face Stylizer به شما امکان میدهد استایلسازیهای صورت را روی چهرههای یک تصویر اعمال کنید. می توانید از این کار برای ایجاد آواتارهای مجازی در سبک های مختلف استفاده کنید.
این کار از مدل BlazeFaceStylizer استفاده می کند که از یک مولد چهره و یک رمزگذار چهره تشکیل شده است. ژنراتور چهره BlazeStyleGAN که یک پیاده سازی سبک از خانواده مدل StyleGAN است، چهره ها را بر اساس یک سبک مشخص تولید و ویرایش می کند. رمزگذار چهره، که از ستون فقرات MobileNet V2 استفاده می کند، تصاویر ورودی را به چهره های تولید شده توسط مولد چهره نگاشت می کند.
استفاده از این کار را با دنبال کردن یکی از این راهنماهای پیاده سازی برای پلتفرم هدف خود شروع کنید. این راهنماهای مخصوص پلتفرم شما را با استفاده از نمونههای مدل و کد پیشنهادی با گزینههای پیکربندی توصیهشده، از طریق اجرای اساسی این کار راهنمایی میکنند:
این بخش قابلیت ها، ورودی ها، خروجی ها و گزینه های پیکربندی این کار را شرح می دهد.
ویژگی ها
پردازش تصویر ورودی - پردازش شامل چرخش تصویر، تغییر اندازه، عادی سازی و تبدیل فضای رنگی است.
ورودی های وظیفه
خروجی های وظیفه
تصاویر ثابت
Face Stylizer یک تصویر را با سبکسازی برجستهترین چهره از تصویر ورودی خروجی میدهد.
گزینه های پیکربندی
این کار دارای گزینه های پیکربندی زیر است:
نام گزینه
توضیحات
محدوده ارزش
مقدار پیش فرض
errorListener
یک شنونده خطای اختیاری را تنظیم می کند.
N/A
Not set
مدل ها
Face Stylizer به یک مدل استایلسازی چهره نیاز دارد که دانلود و در فهرست پروژه شما ذخیره شود. مدلهای استایلسازی چهره در این بخش بر اساس معماری BlazeStyleGAN طراحی شدهاند. هر مدل برای اعمال یک سبک خاص به چهرهها در تصاویر ورودی آموزش داده شد.
طرح رنگی
این مدل چهرهها را به تصویری تبدیل میکند که طرحی را با ضربات مداد رنگی و قلم مو تقلید میکند. سبک مورد استفاده برای آموزش این مدل در زیر نشان داده شده است:
تاریخ آخرین بهروزرسانی 2025-01-13 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-01-13 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Face stylization guide\n\n| **Attention:** The MediaPipe Face Stylizer task is experimental and under active development.\n\nThe MediaPipe Face Stylizer task lets you apply face stylizations to faces in an image.\nYou can use this task to create virtual avatars in various styles.\n\nThe task uses the BlazeFaceStylizer model, which consists of a face generator\nand a face encoder. The BlazeStyleGAN face generator, which is a lightweight\nimplementation of the [StyleGAN](https://arxiv.org/abs/1812.04948) model family,\ngenerates and edits faces according to a specified style. The face encoder,\nwhich uses a [MobileNet V2](https://arxiv.org/abs/1801.04381) backbone, maps\ninput images to the faces generated by the face generator.\n\n[Try it!arrow_forward](https://mediapipe-studio.webapps.google.com/studio/demo/face_stylizer)\n\nGet Started\n-----------\n\nStart using this task by following one of these implementation guides for your\ntarget platform. These platform-specific guides walk you through a basic\nimplementation of this task, using a recommended model and code examples with\nthe recommended configuration options:\n\n- **Android** - [Code example](https://github.com/google-ai-edge/mediapipe-samples/tree/main/examples/face_stylizer/android) - [Guide](./android)\n- **Python** - [Code example](https://colab.sandbox.google.com/github/googlesamples/mediapipe/blob/main/examples/face_stylizer/python/face_stylizer.ipynb) - [Guide](./python)\n- **Web** - [Code example](https://codepen.io/mediapipe-preview/pen/wvRBPmR) - [Guide](./web_js)\n\nTask details\n------------\n\nThis section describes the capabilities, inputs, outputs, and configuration\noptions of this task.\n\n### Features\n\n- **Input image processing** - Processing includes image rotation, resizing, normalization, and color space conversion.\n\n| Task inputs | Task outputs |\n|--------------|----------------------------------------------------------------------------------------------------|\n| Still images | Face Stylizer outputs an image with a stylization of the most prominent face from the input image. |\n\n| **Note:** This task supports the modification of the provided ML models and custom models. For more information on using modified or custom models for this task, see the [customization guide](../../customization/face_stylizer).\n\n### Configurations options\n\nThis task has the following configuration options:\n\n| Option Name | Description | Value Range | Default Value |\n|-----------------|----------------------------------|-------------|---------------|\n| `errorListener` | Sets an optional error listener. | `N/A` | `Not set` |\n\nModels\n------\n\nThe Face Stylizer requires a face stylization model to be downloaded and\nstored in your project directory. The face stylization models in this section\nare based on the\n[BlazeStyleGAN](https://openaccess.thecvf.com/content/CVPR2023W/ECV/papers/Jia_BlazeStyleGAN_A_Real-Time_On-Device_StyleGAN_CVPRW_2023_paper.pdf)\narchitecture. Each model was trained to apply a specific style to faces within\ninput images.\n| **Attention:** This MediaPipe Solutions Preview is an early release. [Learn more](/edge/mediapipe/solutions/about#notice).\n\n### Color sketch\n\nThe model transforms faces into an image that mimics a sketch with colored\npencil strokes and brush strokes. The style used to train this model is shown below:\n\n| Model name | Input shape | Quantization type | Versions |\n|--------------------------------------------------------------------------------------------------------------------------------------------------|---------------|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------|\n| [Color sketch](https://storage.googleapis.com/mediapipe-models/face_stylizer/blaze_face_stylizer/float32/latest/face_stylizer_color_sketch.task) | 256 x 256 x 3 | Float32 | [Latest](https://storage.googleapis.com/mediapipe-models/face_stylizer/blaze_face_stylizer/float32/latest/face_stylizer_color_sketch.task) |\n\n### Color ink\n\nThe model transforms faces into an image that mimics a watercolor painting.\nThe style used to train this model is shown below:\n\n| Model name | Input shape | Quantization type | Versions |\n|--------------------------------------------------------------------------------------------------------------------------------------------|---------------|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------|\n| [Color ink](https://storage.googleapis.com/mediapipe-models/face_stylizer/blaze_face_stylizer/float32/latest/face_stylizer_color_ink.task) | 256 x 256 x 3 | Float32 | [Latest](https://storage.googleapis.com/mediapipe-models/face_stylizer/blaze_face_stylizer/float32/latest/face_stylizer_color_ink.task) |\n\n### Oil painting\n\nThe model transforms faces into an image that mimics an oil painting.\nThe style used to train this model is shown below:\n\n| Model name | Input shape | Quantization type | Versions |\n|--------------------------------------------------------------------------------------------------------------------------------------------------|---------------|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------|\n| [Oil painting](https://storage.googleapis.com/mediapipe-models/face_stylizer/blaze_face_stylizer/float32/latest/face_stylizer_oil_painting.task) | 256 x 256 x 3 | Float32 | [Latest](https://storage.googleapis.com/mediapipe-models/face_stylizer/blaze_face_stylizer/float32/latest/face_stylizer_oil_painting.task) |"]]