Skip to content

Commit

Permalink
new folder for inference files
Browse files Browse the repository at this point in the history
  • Loading branch information
Danyache committed Dec 15, 2021
1 parent 794d0b9 commit cf5cc13
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 48 deletions.
72 changes: 24 additions & 48 deletions SberSwapInference.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"cell_type": "code",
"execution_count": 1,
"id": "lightweight-atlas",
"id": "cellular-michael",
"metadata": {},
"outputs": [
{
Expand All @@ -20,9 +20,9 @@
"import torch\n",
"import time\n",
"\n",
"from utils.image_processing import crop_face\n",
"from utils.video_processing import read_video, get_final_video_frame, add_audio_from_another_video\n",
"from utils.core import model_inference\n",
"from utils.inference.image_processing import crop_face\n",
"from utils.inference.video_processing import read_video, get_final_video_frame, add_audio_from_another_video\n",
"from utils.inference.core import model_inference\n",
"\n",
"from network.AEI_Net import AEI_Net\n",
"from coordinate_reg.image_infer import Handler\n",
Expand All @@ -32,7 +32,7 @@
},
{
"cell_type": "markdown",
"id": "typical-herald",
"id": "equipped-exploration",
"metadata": {},
"source": [
"### Load Models"
Expand All @@ -41,33 +41,9 @@
{
"cell_type": "code",
"execution_count": null,
"id": "documentary-hudson",
"id": "overall-request",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/jovyan/.local/lib/python3.8/site-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n",
" and should_run_async(code)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"input mean and std: 127.5 127.5\n",
"find model: ./insightface_func/models/antelope/glintr100.onnx recognition\n",
"find model: ./insightface_func/models/antelope/scrfd_10g_bnkps.onnx detection\n",
"set det-size: (640, 640)\n",
"loading ./coordinate_reg/model/2d106det 0\n",
"input mean and std: 127.5 127.5\n",
"find model: ./insightface_func/models/antelope/glintr100.onnx recognition\n",
"find model: ./insightface_func/models/antelope/scrfd_10g_bnkps.onnx detection\n",
"set det-size: (640, 640)\n"
]
}
],
"outputs": [],
"source": [
"app = Face_detect_crop(name='antelope', root='./insightface_func/models')\n",
"app.prepare(ctx_id= 0, det_thresh=0.6, det_size=(640,640))\n",
Expand All @@ -91,7 +67,7 @@
},
{
"cell_type": "markdown",
"id": "functioning-impact",
"id": "outdoor-consensus",
"metadata": {},
"source": [
"### Set here path to source image and video for faceswap"
Expand All @@ -100,7 +76,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "other-martial",
"id": "major-employment",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -118,7 +94,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "multiple-redhead",
"id": "adult-forth",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -135,7 +111,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "mathematical-chapter",
"id": "under-maryland",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -146,7 +122,7 @@
},
{
"cell_type": "markdown",
"id": "independent-immune",
"id": "productive-prisoner",
"metadata": {},
"source": [
"### Model Inference"
Expand All @@ -155,7 +131,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "affiliated-reading",
"id": "fourth-procurement",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -165,7 +141,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "outstanding-multiple",
"id": "acceptable-liberal",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -180,7 +156,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "rising-requirement",
"id": "olympic-shaft",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -196,7 +172,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "wired-plane",
"id": "double-oxide",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -206,7 +182,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "continuous-glossary",
"id": "voluntary-marketing",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -217,49 +193,49 @@
{
"cell_type": "code",
"execution_count": null,
"id": "tough-reply",
"id": "american-costs",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "experimental-lexington",
"id": "framed-breeding",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "usual-bhutan",
"id": "applied-laundry",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "coastal-cleveland",
"id": "detected-limitation",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "transsexual-johnson",
"id": "saved-darkness",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "facesh",
"display_name": "fs_env",
"language": "python",
"name": "facesh"
"name": "fs_env"
},
"language_info": {
"codemirror_mode": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit cf5cc13

Please sign in to comment.