Skip to content

Commit 722a07c

Browse files
author
ChrisMaunder
committed
Coreected security issue with rembg
1 parent 1f645c0 commit 722a07c

File tree

3 files changed

+91
-118
lines changed

3 files changed

+91
-118
lines changed
Lines changed: 72 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,75 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
3-
<PropertyGroup>
4-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5-
<SchemaVersion>2.0</SchemaVersion>
6-
<ProjectGuid>{470d3417-36a4-49a4-b719-496466fa92fc}</ProjectGuid>
7-
<ProjectHome />
8-
<StartupFile>rembg_adapter.py</StartupFile>
9-
<SearchPath>..\SDK\Python</SearchPath>
10-
<WorkingDirectory>.</WorkingDirectory>
11-
<OutputPath>.</OutputPath>
12-
<ProjectTypeGuids>{888888a0-9f3d-457c-b088-3a5042f75d52}</ProjectTypeGuids>
13-
<LaunchProvider>Standard Python launcher</LaunchProvider>
14-
<InterpreterId>MSBuild|venv|$(MSBuildProjectFullPath)</InterpreterId>
15-
<EnableNativeCodeDebugging>False</EnableNativeCodeDebugging>
16-
<Name>BackgroundRemover</Name>
17-
<IsWindowsApplication>False</IsWindowsApplication>
18-
</PropertyGroup>
19-
<PropertyGroup Condition="'$(Configuration)' == 'Debug'" />
20-
<PropertyGroup Condition="'$(Configuration)' == 'Release'" />
21-
<PropertyGroup>
22-
<VisualStudioVersion Condition=" '$(VisualStudioVersion)' == '' ">10.0</VisualStudioVersion>
23-
</PropertyGroup>
24-
<ItemGroup>
25-
<Content Include="modulesettings.json" />
26-
<Content Include="requirements.txt" />
27-
<Content Include="test.html" />
28-
</ItemGroup>
29-
<ItemGroup>
30-
<Compile Include="rembg.py" />
31-
<Compile Include="rembg\bg.py" />
32-
<Compile Include="rembg\cli.py" />
33-
<Compile Include="rembg\session_base.py" />
34-
<Compile Include="rembg\session_cloth.py" />
35-
<Compile Include="rembg\session_factory.py" />
36-
<Compile Include="rembg\session_simple.py" />
37-
<Compile Include="rembg\_version.py" />
38-
<Compile Include="rembg\__init__.py" />
39-
<Compile Include="rembg_adapter.py" />
40-
<Compile Include="__init__.py" />
41-
</ItemGroup>
42-
<ItemGroup>
43-
<Folder Include="rembg\" />
44-
</ItemGroup>
45-
<ItemGroup>
46-
<InterpreterReference Include="MSBuild|env|C:\Users\matth\source\repos\CodeProject.AI\src\AnalysisLayer\BackgroundRemover\BackgroundRemover.pyproj" />
47-
</ItemGroup>
48-
<ItemGroup>
49-
<Interpreter Include="..\bin\windows\python39\venv\">
50-
<Id>venv</Id>
51-
<Version>3.9</Version>
52-
<Description>venv (Python 3.9 (64-bit))</Description>
53-
<InterpreterPath>Scripts\python.exe</InterpreterPath>
54-
<WindowsInterpreterPath>Scripts\pythonw.exe</WindowsInterpreterPath>
55-
<PathEnvironmentVariable>PYTHONPATH</PathEnvironmentVariable>
56-
<Architecture>X64</Architecture>
57-
</Interpreter>
58-
</ItemGroup>
59-
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets" />
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<SchemaVersion>2.0</SchemaVersion>
6+
<ProjectGuid>{470d3417-36a4-49a4-b719-496466fa92fc}</ProjectGuid>
7+
<ProjectHome />
8+
<StartupFile>rembg_adapter.py</StartupFile>
9+
<SearchPath>..\SDK\Python</SearchPath>
10+
<WorkingDirectory>.</WorkingDirectory>
11+
<OutputPath>.</OutputPath>
12+
<ProjectTypeGuids>{888888a0-9f3d-457c-b088-3a5042f75d52}</ProjectTypeGuids>
13+
<LaunchProvider>Standard Python launcher</LaunchProvider>
14+
<InterpreterId>MSBuild|venv|$(MSBuildProjectFullPath)</InterpreterId>
15+
<EnableNativeCodeDebugging>False</EnableNativeCodeDebugging>
16+
<Name>BackgroundRemover</Name>
17+
<IsWindowsApplication>False</IsWindowsApplication>
18+
</PropertyGroup>
19+
20+
<PropertyGroup Condition="'$(Configuration)' == 'Debug'" />
21+
<PropertyGroup Condition="'$(Configuration)' == 'Release'" />
22+
23+
<PropertyGroup>
24+
<VisualStudioVersion Condition=" '$(VisualStudioVersion)' == '' ">10.0</VisualStudioVersion>
25+
</PropertyGroup>
26+
27+
<ItemGroup>
28+
<Content Include="test.html" />
29+
<Content Include="modulesettings.json" />
30+
<Content Include="requirements.txt" />
31+
<Content Include="requirements.gpu.txt">
32+
<DependentUpon>requirements.txt</DependentUpon>
33+
</Content>
34+
<Content Include="requirements.macos-arm.txt">
35+
<DependentUpon>requirements.txt</DependentUpon>
36+
</Content>
37+
<Content Include="requirements.macos.txt">
38+
<DependentUpon>requirements.txt</DependentUpon>
39+
</Content>
40+
</ItemGroup>
41+
42+
<ItemGroup>
43+
<Compile Include="rembg.py" />
44+
<Compile Include="rembg\bg.py" />
45+
<Compile Include="rembg\cli.py" />
46+
<Compile Include="rembg\session_base.py" />
47+
<Compile Include="rembg\session_cloth.py" />
48+
<Compile Include="rembg\session_factory.py" />
49+
<Compile Include="rembg\session_simple.py" />
50+
<Compile Include="rembg\_version.py" />
51+
<Compile Include="rembg\__init__.py" />
52+
<Compile Include="rembg_adapter.py" />
53+
<Compile Include="__init__.py" />
54+
</ItemGroup>
55+
56+
<ItemGroup>
57+
<Folder Include="rembg\" />
58+
</ItemGroup>
59+
<ItemGroup>
60+
<InterpreterReference Include="MSBuild|env|C:\Users\matth\source\repos\CodeProject.AI\src\AnalysisLayer\BackgroundRemover\BackgroundRemover.pyproj" />
61+
</ItemGroup>
62+
63+
<ItemGroup>
64+
<Interpreter Include="..\bin\windows\python39\venv\">
65+
<Id>venv</Id>
66+
<Version>3.9</Version>
67+
<Description>venv (Python 3.9 (64-bit))</Description>
68+
<InterpreterPath>Scripts\python.exe</InterpreterPath>
69+
<WindowsInterpreterPath>Scripts\pythonw.exe</WindowsInterpreterPath>
70+
<PathEnvironmentVariable>PYTHONPATH</PathEnvironmentVariable>
71+
<Architecture>X64</Architecture>
72+
</Interpreter>
73+
</ItemGroup>
74+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets" />
6075
</Project>

src/AnalysisLayer/BackgroundRemover/RemoveBackground.pyproj

Lines changed: 0 additions & 54 deletions
This file was deleted.

src/AnalysisLayer/BackgroundRemover/requirements.txt

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,27 @@
44
requests # Installing Requests, the HTTP library
55
Pillow # Installing Pillow, a Python Image Library
66

7-
## Background Remover
8-
filetype==1.0.9 # Installing FileType, a package to infer file types and MIME types
9-
gdown==4.4.0 # Installing gdown, a package for downloading from Google Drive folders
10-
numpy<=1.21.6 # Installing the required version of numpy of pymatting - numba
11-
pymatting==1.1.5 # Installing pymatting, a Python Library for Alpha Matting
7+
## Background Remover - original, but have a security issue
8+
## filetype==1.0.9 # Installing FileType, a package to infer file types and MIME types
9+
## gdown==4.4.0 # Installing gdown, a package for downloading from Google Drive folders
10+
## numpy<=1.21.6 # Installing the required version of numpy of pymatting - numba
11+
## pymatting==1.1.5 # Installing pymatting, a Python Library for Alpha Matting
1212

13-
## For Running on Intel Processors
13+
## Background Remover - tested and working
14+
## filetype==1.1.0 # Installing FileType, a package to infer file types and MIME types
15+
## gdown==4.5.1 # Installing gdown, a package for downloading from Google Drive folders
16+
## numpy==1.22.4 # Installing the required version of numpy of pymatting - numba
17+
## pymatting==1.1.8 # Installing pymatting, a Python Library for Alpha Matting
18+
19+
## Background Remover - latest
20+
filetype # Installing FileType, a package to infer file types and MIME types
21+
gdown # Installing gdown, a package for downloading from Google Drive folders
22+
numpy # Installing the required version of numpy of pymatting - numba
23+
pymatting # Installing pymatting, a Python Library for Alpha Matting
24+
25+
## For GPU, including embedded Intel GPUs
1426
## openvino # need the OpenVino Execution Provider
15-
# #onnxruntime-openvino # Installing the ONNX runtime
27+
## onnxruntime-openvino # Installing the ONNX runtime
1628

1729
## For CPU
1830
onnxruntime # Installing the ONNX runtime

0 commit comments

Comments
 (0)