facebookresearch / AnimatedDrawings

Code to accompany "A Method for Animating Children's Drawings of the Human Figure"
MIT License
10.62k stars 936 forks source link

What is the file type for the images!??? #299

Closed raahim-syed closed 3 months ago

raahim-syed commented 3 months ago

``I've been trying to read th 50GB images file to train my own model for pose estimation but I cannot figure out the file extennsion or the encoding. Eveytime I open it with python using different encodings I get an error similar to this one:

UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 1614: character maps to

I know the reason for this error but what is the encoding of this file, please somebody give me some direction on how to work with this data so that I can train a model.

Code To Check File Details

`import os import sys import mimetypes

def get_file_details(file_path): if not os.path.isfile(file_path): print(f"The path {file_path} does not point to a valid file.") return

file_name = os.path.basename(file_path)
file_extension = os.path.splitext(file_path)[1]
file_size = os.path.getsize(file_path)
mime_type, _ = mimetypes.guess_type(file_path)

print(f"File Name: {file_name}")
print(f"File Extension: {file_extension}")
print(f"File Size: {file_size} bytes")
print(f"MIME Type: {mime_type}")

if name == "main": if len(sys.argv) != 2: print("Usage: python file.py ") else: get_file_details(sys.argv[1])

    file = open(sys.argv[1], "r", encoding="windows-1252", errors="ignore")
    content = file.read(10000)

    print(content)`
hjessmith commented 3 months ago

It's a compressed tar file. Try this to extract it:

tar -xvzf amateur_drawings.tar

raahim-syed commented 3 months ago

Hi Jesse,

I hope this email finds you well.

Firstly, I want to express my sincere gratitude for your invaluable assistance with my project. Your guidance has been a tremendous help, especially given the stress this project has caused me.

I have one more question, which stems from a bit of curiosity on my part. Recently, I attempted to decompress a .tar file using WinRAR. However, instead of extracting the expected contents, I ended up with a single file with no extension. This outcome was quite different from the results I achieved using the command you provided, which successfully generated images from the archive.

Could you kindly shed some light on why this discrepancy occurred? I’m eager to understand what might have gone wrong during my attempt with WinRAR and how I can ensure proper decompression in the future.

Thank you once again for all your support.

Best regards, Raahim

On Fri, Aug 16, 2024 at 9:34 PM hjessmith @.***> wrote:

It's a compressed tar file. Try this to extract it:

tar -xvzf amateur_drawings.tar

— Reply to this email directly, view it on GitHub https://github.com/facebookresearch/AnimatedDrawings/issues/299#issuecomment-2293814733, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3ZQAEIX3BHESJJ7TDZDGPLZRYS2HAVCNFSM6AAAAABMUG54W2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJTHAYTINZTGM . You are receiving this because you authored the thread.Message ID: @.***>