CODAIT / magicat

🧙😺 magicat - Deep learning magic.. with the convenience of cat!
Apache License 2.0
26 stars 5 forks source link

magical cannot handle absolute path names #3

Closed ptitzler closed 5 years ago

ptitzler commented 5 years ago
$ magicat --version 
1.5.2

Relative path spec: OK

$ magicat ../max/MAX-Image-Segmenter-Web-App/assets/
Scanning directory '/Users/patti/think/../max/MAX-Image-Segmenter-Web-App/assets'...

The image 'airplane.jpg' contains the following segments: background, airplane.
The image 'aurora borealis.jpg' contains the following segments: background.
...

Absolute path spec: FAIL

$ magicat /Users/patti/max/MAX-Image-Segmenter-Web-App/assets/
Scanning directory '/Users/patti/max/MAX-Image-Segmenter-Web-App/assets'...

error building response map - error preprocessing image - Error: ENOENT: no such file or directory, open '/Users/patti/think//Users/patti/max/MAX-Image-Segmenter-Web-App/assets/airplane.jpg'
kastentx commented 5 years ago

Thank you for catching this!

Just pushed an update with a fix.

@kastentx~/Pictures/llamas> magicat --version
1.5.3

Absolute path (in cwd):

@kastentx~/Pictures/llamas> magicat /Users/nick/Pictures/llamas/llama-macchu-pichu.jpg
The image '/Users/nick/Pictures/llamas/llama-macchu-pichu.jpg' contains the following segments: background, sheep, dog, cat.

Absolute path (non cwd):

@kastentx~> magicat /Users/nick/Pictures/llamas/llama-macchu-pichu.jpg
The image '/Users/nick/Pictures/llamas/llama-macchu-pichu.jpg' contains the following segments: background, sheep, dog, cat.

Absolute + Relative combo:

@kastentx~> magicat /Users/nick/Pictures/llamas/../doggy.jpg
The image '/Users/nick/Pictures/llamas/../doggy.jpg' contains the following segments: background, dog, person.
kastentx commented 5 years ago

Directory support (for good measure):

@kastentx~> magicat /Users/nick/Pictures/llamas/
Scanning directory '/Users/nick/Pictures/llamas'...

The image 'candy-llama.jpeg' contains the following segments: background, dog, bird, cat.
The image 'llama-macchu-pichu copy.jpg' contains the following segments: background, sheep, dog, cat.
The image 'llama-macchu-pichu.jpg' contains the following segments: background, sheep, dog, cat.
The image 'mosaic-llama.jpeg' contains the following segments: background, bird, potted plant.
The image 'rain_princess-llama.jpeg' contains the following segments: background, bird.
The image 'udnie-llama.jpeg' contains the following segments: background, bird.