Skip to content

Commit

Permalink
fix: model file paths
Browse files Browse the repository at this point in the history
  • Loading branch information
dk-a-dev committed Feb 3, 2025
1 parent 39b0e4f commit 713e1e9
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 399 deletions.
10 changes: 5 additions & 5 deletions art-gallery/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/*

# Download model
RUN mkdir -p /app/arbitrary-image-stylization-v1-tensorflow1-256-v2 && \
curl -L -o /app/arbitrary-image-stylization-v1-tensorflow1-256-v2.tar.gz \
RUN mkdir -p /usr/src/app/app/utils/arbitrary-image-stylization-v1-tensorflow1-256-v2 && \
curl -L -o /usr/src/app/app/utils/arbitrary-image-stylization-v1-tensorflow1-256-v2.tar.gz \
https://www.kaggle.com/api/v1/models/google/arbitrary-image-stylization-v1/tensorFlow1/256/2/download && \
tar -xvzf /app/arbitrary-image-stylization-v1-tensorflow1-256-v2.tar.gz -C /app/arbitrary-image-stylization-v1-tensorflow1-256-v2 && \
rm /app/arbitrary-image-stylization-v1-tensorflow1-256-v2.tar.gz
tar -xvzf /usr/src/app/app/utils/arbitrary-image-stylization-v1-tensorflow1-256-v2.tar.gz -C /usr/src/app/app/utils/arbitrary-image-stylization-v1-tensorflow1-256-v2 && \
rm /usr/src/app/app/utils/arbitrary-image-stylization-v1-tensorflow1-256-v2.tar.gz

# Copy the rest of the application files into the container
COPY . .

# Expose the port the app runs on
EXPOSE 3000
EXPOSE 8000

# Specify the command to run your application
CMD ["node", "app.js"]
3 changes: 2 additions & 1 deletion art-gallery/app/utils/style-transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ async function stylizeImages(contentImagePath, styleImagePath) {
const styleImage = await resizeStyleImage(styleImagePath);

// Load the style transfer model
const modelPath = path.resolve(__dirname, "../arbitrary-image-stylization-v1-tensorflow1-256-v2");
const modelPath = path.resolve(__dirname, "./arbitrary-image-stylization-v1-tensorflow1-256-v2");

const styleTransferModel = await tf.node.loadSavedModel(modelPath);

// Stylize the image
Expand Down
2 changes: 1 addition & 1 deletion art-gallery/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ services:
ports:
- "8000:8000"
env_file:
- .env
- art-gallery/.env
Loading

0 comments on commit 713e1e9

Please sign in to comment.