Introduction
In my previous open-source project MaterialSearch, many users requested a Windows-integrated version because configuring the environment on Windows can be quite troublesome—especially for beginners who may not know how to install everything properly. So I decided to try building a standalone Windows package.
Steps
Create a new folder called
MaterialSearchWindows
.Download the project source code, extract it, and copy the contents into the
MaterialSearchWindows/MaterialSearch
directory.Download Python. Since PyTorch supports up to Python 3.10 on Windows, we’ll use that version. Download the Windows installer (64-bit) and install it as a user into a specific folder—directly into
MaterialSearch
.Use pip to install dependencies. Run the following command:
1
.\python -m pip install -r .\MaterialSearch\requirements.txt --index-url=https://download.pytorch.org/whl/cu118 --extra-index-url=https://pypi.org/simple/
Create a new batch file called
run.bat
with the following content. Execute it to let the model download completely:1 2 3
SET TRANSFORMERS_CACHE=..\huggingface cd MaterialSearch ..\python main.py
After the model is downloaded, modify
run.bat
with the following:1 2 3 4 5 6 7 8 9 10 11
:: Configure asset scan paths, separated by commas SET ASSETS_PATH=C:/Users/Administrator/Pictures,C:/Users/Administrator/Videos :: Configure the device: cpu or cuda SET DEVICE=cpu SET DEVICE_TEXT=cpu :: Do not modify below SET PATH=%PATH%;..\ SET TRANSFORMERS_OFFLINE=1 SET TRANSFORMERS_CACHE=..\huggingface cd MaterialSearch ..\python main.py
Download FFMpeg, extract it, and copy
ffmpeg.exe
into theMaterialSearchWindows
directory.Finally, compress the entire folder into a zip package. To launch the program later, simply run
run.bat
.
The final directory structure should look like this:
|
|