Recherche avancée

Médias (33)

Mot : - Tags -/creative commons

Autres articles (36)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (5304)

  • Revision 66064 : Gestion des abonnements aux notifications par la page ...

    19 septembre 2012, par cedric@… — Log

    Gestion des abonnements aux notifications par la page ?page=notifications&amp ;email=xx&amp ;key=yyy qui permet de gerer les abonnements/desabonnements aux threads de forum envoyés à cette adresse mail
    Ajout du message dans le pied du forum dans le squelette du forum
    TODO : gestion du changement d’email d’abonnement

  • Anomalie #4052 : Visualiser ses messages dans le privé

    28 novembre 2017, par tcharlss (*´_ゝ`)

    J’ai bien ce lien sur contrib, spip.net et forum. C’est tout en bas de la boîte d’infos :

    AUTEUR NUMÉRO
    

    6944

    Je suis rédacteur
    4 articles
    24 messages de forum
    Voir en ligne

  • Saving mp4 files into csv for training the data

    4 février 2021, par KSp

    I am very new to the computer vision field and I am trying to train my model and as a start of the work, I used a label encoder to label my videos for events I am using. Here I have two events which are accident and no accident.

    


    Folder Structure for the images :

    


    Colab_Notebooks
- accident(all the .jpg frames are here)
- nonaccident(all the .jpg frames are here)


    


    So my data.csv file looks like this and code given below.

    


    data.csv 
image_path,target
/content/drive/MyDrive/Colab_Notebooks/accident/accident_0000638.jpg,0.0
/content/drive/MyDrive/Colab_Notebooks/nonaccident/nonaccident_0002143.jpg,1.0
/content/drive/MyDrive/Colab_Notebooks/accident/accident_0000372.jpg,0.0
/content/drive/MyDrive/Colab_Notebooks/accident/accident_0000419.jpg,0.0
/content/drive/MyDrive/Colab_Notebooks/nonaccident/nonaccident_0001675.jpg,1.0
/content/drive/MyDrive/Colab_Notebooks/accident/accident_0000307.jpg,0.0
/content/drive/MyDrive/Colab_Notebooks/accident/accident_00001099.jpg,0.0
/content/drive/MyDrive/Colab_Notebooks/accident/accident_0000940.jpg,0.0
/content/drive/MyDrive/Colab_Notebooks/accident/accident_0000892.jpg,0.0
/content/drive/MyDrive/Colab_Notebooks/accident/accident_0000805.jpg,0.0
/content/drive/MyDrive/Colab_Notebooks/accident/accident_0000232.jpg,0.0
/content/drive/MyDrive/Colab_Notebooks/accident/accident_0000255.jpg,0.0
/content/drive/MyDrive/Colab_Notebooks/accident/accident_0000840.jpg,0.0
/content/drive/MyDrive/Colab_Notebooks/accident/accident_0000974.jpg,0.0


    


    The code i used for generating data.csv is as shown below :

    


    all_paths = os.listdir('/content/drive/MyDrive/Colab_Notebooks/')

folder_paths = [x for x in all_paths if os.path.isdir('/content/drive/MyDrive/Colab_Notebooks/' + x )]

print(f"Folder paths : {folder_paths}")
print (f"Number of folders: {len(folder_paths)}")
create_labels = ['accident','nonaccident']

data = pd.DataFrame()

image_formats = ['jpg']
labels = []
counter = 0
for i, folder_path in tqdm(enumerate(folder_paths), total = len(folder_paths)):
    if folder_path not in create_labels:
        continue
    image_paths = os.listdir('/content/drive/MyDrive/Colab_Notebooks/' + folder_path)
    label = folder_path

    for image_path in image_paths:
        if image_path.split('.')[-1] in image_formats:
            data.loc[counter,'image_path'] =  f"/content/drive/MyDrive/Colab_Notebooks/{folder_path}/{image_path}"
            labels.append(label)
            counter += 1
labels = np.array(labels)
# one-hot encode the labels
lb = LabelBinarizer()
labels = lb.fit_transform(labels)

#print(labels)

# save as CSV file
data.to_csv('/content/drive/MyDrive/Colab_Notebooks/data.csv', index=False)

# pickle the binarized labels
print('Saving the binarized labels as pickled file')
joblib.dump(lb, '/content/drive/MyDrive/Colab_Notebooks/lb.pkl')

print(data.head(5))


    


    I was able to do this fine because the dataset you see on top is frames which are jpg images. But I would like to do the same for videos.

    


    Colab_Notebooks
- accident(all the .mp4 clips are here)
- nonaccident(all the .mp4 clips are here)

Expected output:
/content/drive/MyDrive/Colab_Notebooks/accident/accident_0000638.mp4,0.0
/content/drive/MyDrive/Colab_Notebooks/nonaccident/nonaccident_0002143.mp4,1.0
/content/drive/MyDrive/Colab_Notebooks/accident/accident_0000372.mp4,0.0
/content/drive/MyDrive/Colab_Notebooks/accident/accident_0000419.mp4,0.0
/content/drive/MyDrive/Colab_Notebooks/nonaccident/nonaccident_0001675.mp4,1.0
/content/drive/MyDrive/Colab_Notebooks/accident/accident_0000307.mp4,0.0


    


    Could someone tell me how do I modify the code to read the video clips instead of images ?