Using PyPotteryInk


Need a hand?
Look for Pixel in the app!
Clicking on him brings you straight back to this guide.

Interface Overview

The PyPotteryInk interface is divided into four main tabs:

  • Hardware Check
  • Model Diagnostic
  • Preprocessing
  • Batch Processing

Additionally, you can toggle Dark Mode using the button in the interface.

Hardware Check

This tab allows you to analyze your PC’s hardware to verify compatibility with PyPotteryInk.

The page displays Recommended Specifications, indicating the minimum requirements to use the program.

Clicking on 🔍 Check Hardware will display your machine’s specifications along with a performance score.

Preprocessing

This tab allows you to process images by adjusting statistics (contrast, etc.) to fit within a range known by the model.

You can use an existing .npy file to apply the statistics to the images.

PyPotteryInk provides two default .npy files:

  • Montale_stats.npy (Metric measures of the dataset used to train the 6h-MCG model)
  • Cimino_stats.npy (Metric measures of the dataset used to train the 6h-MC model)

In short, these metrics can be used to make your images resemble those used to train the model.

The Output Directory text box allows you to indicate where the modified images will be saved. Click ✨ Apply Preprocessing to start. A progress bar will indicate the status.

Note

In the “Advanced” section, you can calculate statistics from a set of images. Uploading is done in the same way as the previous tab. The Save Statistics As text box allows you to decide the path and name of the .npy file. Click 📊 Calculate Statistics to perform the calculation.

Model Diagnostic

This tab allows you to test the model on a single image to verify its operation and determine the best parameters for batch processing.

The available elements are:

  • Select Model: Allows you to select the model to use (see the Model Zoo section for details). The model will be automatically downloaded during processing.
  • Patch Size: Determines the size of the “chunks” the image is divided into for processing. Refer to the dedicated documentation section.
  • Upload Images: This window allows you to upload images. You can use drag-and-drop or a dialog window. Once uploaded, images are displayed as thumbnails.
  • Overlap: Determines the number of pixels where patches overlap. Refer to the dedicated documentation section.
  • Contrast Test Values: The model will generate an enhancement using the indicated values. To add a contrast value for evaluation, separate it with a comma.

Clicking on 🚀 Run Diagnostic will start the process, and a progress bar will indicate advancement. At the end of the process, a gallery will allow you to view the results.

Batch Processing

This tab represents the core of the program where you can process a series of images.

Parameters like Select Model, Upload Images, Patch Size, and Overlap are the same as in the Preprocessing tab.

New parameters include:

  • Output Directory: Allows you to indicate where to save the results.
  • Contrast Scale: Allows you to indicate the contrast value to apply to the batch.
  • Scale Factor: Allows you to temporarily apply upsampling or downsampling to the images. After processing, images will be saved in their original dimensions, so there is no need to rescale them manually.
  • Use FP16: Allows you to apply the model using half-precision (requires CUDA).

Clicking on 🚀 Start Processing will start the operation. A double progress bar will indicate the processing of patches and drawings. The results will be shown in a gallery.