Avatar
🏃
achat android animaux anticor apple arnaque association biot bluesky bricolage canoe canyoning ccesoir chateau choisir-velo cinema citation citroen-c8 commission configuration consomacteur course courses courses-dobstacles cuisine cv-pro dawarich debian dell depannage dev docker don dsi désinformation economie facebook fedora firewall football garmin gohugo gravel hebergement home-assistant hugo humhub inondation internets iphone-ipad jeux justice kali linux livre loisirs mac marathon mastodon mecanique misere momes-dazur musee-loisirs nice-matin non-classe oracle padel petition peugeot-206 peugeot-307 peugeot-406 photos php politique postgresql pro proxmox randonnee randonnée raspberry redhat redis republique-numerique reseaux-sociaux sante-internets sante-loisirs securite-internets self-hosted ski ski de randonnée sortir soutien spam sport-biot-2 sports stockage theatre trail twitter/x twitter/x ubuntu velo velo-biot velo-sur-biot via-ferrata ville villes visites voyage vtt windows wordpress wordpress-fr xbox élections municipales 0189xxxxxx 10-km 10-miles 10km 12-km 140 2014 2kv 307 406 406-hdi 920 920xt 930 935 abus acpi actif azur adb adhesion adsl agay age air aix-en-provence alcatel allianz allianz-riviera alpe-dhuez alpes-maritimes alpilles alternateur amap amazon amp anaconda analyse analytics android animaux anote anthea anthea-fr antibes anticor antutu apache2 apn apple applepi-baker april arcep arfi arnaque aroooo aseb-am asics association assurantprotection.fr asterisk asus asus-zenfone atos atsemtex audit auron authentique-fr autoroute avis awesome-note awk awox baignade balade balade-fr barcelonnette barnier base-de-donnee bash basket-ball belt benchmark bento bentomedia betrail biellette bigreen bilan bilan professionnel bilan sportif bilan-fr bio biot biot-fr biot-vernir bitdefender bkl-l09 blacklist blender blockchain-fr blog blogger-com bluesky bonifacio bormes-les-mimosas bot brague braun breil-sur-roya brew bricolage brm brm200 bruxelles bueil bug c cadolive cagnes-sur-mer caille caisse-depargne calanques calencon calendrier camargue cannes cannes-fr canoe cantabrie canyon canyoning cap-dantibes cardio carlit carnaval-de-nice carnaval-de-nice-fr carros carroz casa castellane castellar cat catamaran caussols ccbot ccc cdisplay ceinture cevennes chamonix chateau chaussures cheiron choisir velo cinema circuit cisco citation citrix classement claudebot clignotant cloud cloud-act cloud-personnel cnews codegouv col connecté col de greoliere col-connecte col-de-la-madone col-de-turini colmars competition compression configuration connect consomacteur conspiracy watch convergence-azureenne coreos coronarivus coronavirus corse courmes course course-a-pied course-dobstacle course-dobstacles course-dorientation course-fr coursegoules courses-2 covid covid-19 cozy-cloud cozytouch cpu critique cross cuda cuenod curl cursor dansup dark-web data dataforseo dawarich dawarich.app day-journal debian decathlon decodex deletefacebook dell dello-sciliar-catinaccio delphi demi-yasso derby-de-la-meije developpement developper-tools-access diag diario diaro diaspora digikam digiposte distribution docker docteur-gsm-com dolceacqua dolomites domolites domotique don dourgne dsi duranus débats désinformation ecologie economie education el-capitan elasticsearch elk elm327 email endurain enphase ensol entreprises entretien epidemie escape-game escarene escroquerie espagne estrosi europe eurovelo evasion-fiscale evolution-a-faire exiftool export eze f-f-a facebook facture facture-deau-fr fakenews falicon fan fayence fedora fenix 7 ffa ffmpeg filebeat fillion fillon film-bon film-moyen filtre-a-gazole filtre-pollen fire firewall fittrackee folder foodwatch footing for forerunner forerunner-935 forerunner-945 forerunner-955 forgejo framasoft framasphere france culture france-3 france-soir fraude fraude-fiscale free free-mobile freebox frejus funchal gafams gaillac garageband garmin garmin-connect gavarnie gcc gelas geodes gilette git github glance gmail goaccess gohugo google google-analytic google-analytics google-search-console gopro gorbio gotify goudurix gouffre gourdon gourdon-fr gptbot gpx grafana grasse gravel graxx greoliere greolieres greolieres-les-neiges grub gréolières gtest guillon hadopi haproxy hautpoul hebergement high-trail-vanoise hintertux hipay hipay-com historique-des-dons holdup home-assistant homeassistant hommage honeywell honor hop howto htv huawei hugo huile-direction-assiste humhub ia ibm iconservicesagent ie ign ilonse imagento imageoptim imagneto immich imovie import impots indent injecteur inondation insee insta360 installation internet intimidation ipad ipad-argus iphone iphoto iptables isola-2000 issue italie itra itunes j2s jaime-courir java javascript jeedom jenkins jetpack jeux jeux-de-sophia jeux-de-sophia-antipolis joplin joseph journey jpegoptim juns jupyter justice kali karer-pass kayak kernel kibana kies-app kilometre-vertical kisskissbankbank kiwix klaxon kodi kokopelli korben la-brague la-capelette la-grave-de-peille la-poste la-quadrature-du-net la-vie lac-de-vens langage lantosque lapeyre laquadrature latemar lateral lautrec lcd le-monde leon les-cammazes les-visiteurs-du-soir let's encrypt lets-encrypt levens libreoffice libvirt lightmd linux liste livebox livre logement logiciel logstash loi-numerique lombricomposteur luberon lulu mac mac-os macjournal macos macos-high-sierra madere malade malware mamp mandelieu maps marathon marche mariadb markdown marseille mastodon matomo matomo-analytics matosdon matrix mazamet mcafee mecanique mediapart meduses meije meltdown memo menuiserie mercantour merci-michel mermaid meta metricbeat microsoft-teams migration misere mkdocs module mogrify mojave monsanto montagne-noire montagne-noire-fr montauroux motionpro mougins moulinet mouton msf mud-day mud-day-fr munin mysql mytf1 mytf1-fr mywellness myzone naiad naiad2020 natation natation-libre nature nautipolis neige netamo netatmo nextcloud nginx nice nice-fr nice-matin notes nsinvalidargumentexception ntfs nuxit nvidia objective-see obsolescence-programmee obstacle occ occasion odbii ok-google ollama olvid onedrive oopad open open-data open-sky open-source open-source-experience opencv opendata opensky opensky-a-valbonne opio oracle-linux orange origine-cycles orsiere osm france osmc oss-paris osx osxp osxp2024 osxp2025 outlook owncloud pac paca padel panorama panoramique paradisdiscount-com parc-du-paradou parc-naturel-dello-sciliar-catinaccio paris pascal paul paypal pdf peillon peinture petition peugeot peugeot-307 phare photo photon photos photovoltaique php phpnet phpnet-org pichauris pigeon pinterest pip piscine planning play-store plongee plu plugin pluviometrie pneu politique pollution polylang postfix postgresql ppri prejuges preparation print prix programmation prom-classic prometheus provence proxmox pssh publicite purge pyrenees python python3 qnap quartier qwant raid rameur-dinterieur rancheros randonnee randonnee-2 randonnees randonnée raspberry recette recette-fr redbysfr redhat redis redmi reparartion reparation reseau-sociaux resideo rest-api resultat reunion revue-de-presse rgpd rimplas rock64 root roquebilliere roubion rouret row rsyslog rt-france rubitrack rue89 saint-amancet-fr saint-avit saint-fereol saint-jeannet saint-vallier-de-thiey saintetic salade-nicoise-fr salle-serveur salon samsung san-remo sante sauter scop sd-card securite security.txt sed selection self-hosted semaine-de-la-critique semi semi-marathon semi-marathon-fr sentier seranon server-git serveur service-public siagne sidobre sierra signal sip ski ski de randonnée ski-de-randonnee skred skype slack smart-home smartphone smsc snap sommets sondage sondage-en-ligne sophia-antipolis soreze soreze-fr sortie-en-famille sospel soual spam spartan spartan-race spartan-race-fr spartian spectre sport sql sqlite ssd stable-diffusion stade station-meteo statistique statistiques stockage strava suisse suivi summary surf svn swap swarm syslog systemd tanneron tapform tarif tarn tarn-fr taxes telerama television temp temperature template templier tende tennis tennis-de-table tensorflow test testeur tests textwrangler theatre theoule-sur-mer thorenc thunderbird thunderbirds tignes tor tour-des-sangliers tour-du-sanglier tourisme tourrettes-sur-loup trail trail-de-la-vesubie transposh transvesubienne trashbusters travail travaux trial trifecta turbie tux tuxedo tuxedo-computer tuya twitter tyrol ubaye ubuntu ufc-que-choisir ultra uniq unknown unroot update urbain urban-trail urbanbiker utcam utelle utmb vae valbonne valeo vallee-des-merveilles valloire vallon-des-horts valmasque var vaucluse vaultwarden vauplane vegay velo velotaf vence ventoux veolia verdon vesubie vidange video villeneuve-loubet vim virtual-box virtualbox virus vma vmware vol voyage vpn vps vtc vtt wanderer wannacry webalizer wget whatsapp wifi wikimedia-foundation wikipedia wiko windows wine woocommerce wordfence wordpress x xbmc xbox yahoo-mail yolo zenfone zenpad zigbee
  • Voici mes commandes pour le ménage dans les photos:

    1- Suppression des doublons :

    # du -sh Photos/
    85G	Photos/
    # fdupes -r -d -f Photos/

    2- Classement par date :

    # sortphotos -r . . --sort %Y/%m/%d

    3- Compression :

    # find Photos/ -iname '*.jpg' -exec mogrify \{} -verbose -resize 1920x1080\> \{} \;

    4- Resynchornisation avec Digikam (le seul bon outils pour les photos sous Ubuntu).

    Created Thu, 04 Feb 2021 00:00:00 +0000
  • Voici la commande que j’utilise pour la recherche de virus sous Ubuntu :

    # clamscan -avr  | tee clamscan.log
    ...
    ----------- SCAN SUMMARY -----------
    Known viruses: 8689881
    Engine version: 0.102.4
    Scanned directories: 89434
    Scanned files: 694669
    Infected files: 7
    Total errors: 4
    Data scanned: 301849.41 MB
    Data read: 449682.82 MB (ratio 0.67:1)
    Time: 28236.392 sec (470 m 36 s)

    Ensuite je fais :

    $ grep FOUND clamscan.log
    ...OpenOffice 4.1.5 (fr) Installation Files/setup.exe: Win.Virus.Expiro-9820425-0 FOUND
    ...OpenOffice 4.1.5 (fr) Installation Files/setup.exe!(0): Win.Virus.Expiro-9820425-0 FOUND
    Created Tue, 02 Feb 2021 00:00:00 +0000
  • Avant la migration j’avais ceci comme kernel:

    Linux CYBERNEURONES 5.4.0-64-generic #72~18.04.1-Ubuntu SMP Fri Jan 15 14:06:34 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

    Début de la migration vers 10h18:

    $ head /var/log/dist-upgrade/main.log
    2021-01-28 10:18:23,079 INFO Using config files '['./DistUpgrade.cfg.bionic', '/etc/update-manager/release-upgrades.d/opera-stable.cfg']'
    2021-01-28 10:18:23,079 INFO uname information: 'Linux CYBERNEURONES 5.4.0-64-generic #72~18.04.1-Ubuntu SMP Fri Jan 15 14:06:34 UTC 2021 x86_64'
    2021-01-28 10:18:23,604 INFO apt version: '1.6.12ubuntu0.2'
    2021-01-28 10:18:23,604 INFO python version: '3.6.9 (default, Oct  8 2020, 12:12:24) 
    [GCC 8.4.0]'
    2021-01-28 10:18:23,609 INFO release-upgrader version '20.04.29' started
    2021-01-28 10:18:23,670 INFO locale: 'fr_FR' 'UTF-8'
    2021-01-28 10:18:23,857 DEBUG Using 'DistUpgradeViewGtk3' view
    2021-01-28 10:18:23,900 DEBUG enable dpkg --force-overwrite
    2021-01-28 10:18:23,915 DEBUG creating statefile: '/var/log/dist-upgrade/apt-clone_system_state.tar.gz'

    Fin de l’installation vers 13h18:

    tuxedo ubuntu Created Thu, 28 Jan 2021 00:00:00 +0000
  • J’avais donc des crash de update-manage, j’ai donc utilisé plusieurs méthodes vu sur Google.

    Voici le crash que j’avais :

    $ update-manager 
    Traceback (most recent call last):
      File "/usr/bin/update-manager", line 28, in 
        import gi
      File "/usr/lib/python3/dist-packages/gi/__init__.py", line 42, in 
        from . import _gi
    ImportError: cannot import name '_gi' from partially initialized module 'gi' (most likely due to a circular import) (/usr/lib/python3/dist-packages/gi/__init__.py)
    
    $ cd /usr/lib/python3/dist-packages/gi/
    /usr/lib/python3/dist-packages/gi$ ls *.so
    _gi_cairo.cpython-36m-x86_64-linux-gnu.so
    _gi.cpython-36m-x86_64-linux-gnu.so
    _gi.cpython-37m-x86_64-linux-gnu.so

    Solution 1 :

    $ sudo apt-get install --reinstall dbus python-dbus python3-dbus

    => Echec.

    ubuntu Created Thu, 28 Jan 2021 00:00:00 +0000
  • Suite à l’update en version Ubuntu 20.04 j’ai essayé de faire une nouvelle tentative ! Ma précédente tentative (11/03/2020 ) : https://www.cyber-neurones.org/2020/03/script-de-creation-automatiquement-dune-machine-virtuelle-de-macos-pour-virtualbox-echec-pour-moi/

    Mes versions :

    $ vboxmanage --version
    6.1.16_Ubuntur140961
    $ cat /etc/os-release 
    NAME="Ubuntu"
    VERSION="20.04.1 LTS (Focal Fossa)"
    ID=ubuntu
    ID_LIKE=debian
    PRETTY_NAME="Ubuntu 20.04.1 LTS"
    VERSION_ID="20.04"
    HOME_URL="https://www.ubuntu.com/"
    SUPPORT_URL="https://help.ubuntu.com/"
    BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
    PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
    VERSION_CODENAME=focal
    UBUNTU_CODENAME=focal

    Il faut mettre le pack extension pour que cela fonctionne : [https://download.virtualbox.org/virtualbox/6.1.16/ .](https://download.virtualbox.org/virtualbox/6.1.16/ .)

    Lancement du script :

    $ ./macos-guest-virtualbox.sh
    Waiting for the VirtualBox GUI to shut off.
    Please wait
    Catalina_BaseSystem.vdi successfully detached from
    the virtual machine and released from VirtualBox Manager.
    
    stage: create_target_virtual_disk
    Creating target system virtual disk image for "macOS"
    0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
    Medium created. UUID: 10868994-4a31-4af9-bc2d-0130f283870d
    
    stage: populate_macos_target_disk
    
    Creating VirtualBox 6 virtual ISO containing macOS Terminal scripts
    for partitioning and populating the target virtual disk.
    
    The VM will boot from the populated installer base system virtual disk.
    
    Attempting automated recognition of virtual machine graphical user interface.
    Please wait
    The second open Terminal in the virtual machine copies EFI and NVRAM files
    to the target EFI system partition when the installer finishes preparing.
    
    After the installer finishes preparing and the EFI and NVRAM files are copied,
    macOS will install and boot up when booting the target disk.
    
    Please wait
    
    For further information, such as applying EFI and NVRAM variables to enable
    iMessage connectivity, see the documentation with the following command:
    
    ./macos-guest-virtualbox.sh documentation | less -R
    
    That's it! Enjoy your virtual machine.
    
    stage: prompt_delete_temporary_files
    Temporary files may be deleted when the virtual machine is powered off
    and without a suspended state by executing the following command at the script's
    working directory:
    
    ./macos-guest-virtualbox.sh prompt_delete_temporary_files
    
    Push-button installer of macOS on VirtualBox
    
    This script installs only open-source software and unmodified Apple binaries,
    and requires about 50GB of available storage, of which 25GB are for temporary
    installation files that may be deleted when the script is finished.
    
    The script interacts with the virtual machine twice, please do not interact
    with the virtual machine manually before the script is finished.
    
    Documentation about optional configuration, iCloud and iMessage connectivity,
    resuming the script by stages, and other topics can be viewed with the
    following command:
    
      ./macos-guest-virtualbox.sh documentation | less -R
    
    Press enter to review the script configuration
    
    vm_name="macOS"
    macOS_release_name="Catalina"    # install "HighSierra" "Mojave" "Catalina"
    storage_size=80000               # VM disk image size in MB. minimum 22000
    storage_format="vdi"             # VM disk image file format, "vdi" or "vmdk"
    cpu_count=2                      # VM CPU cores, minimum 2
    memory_size=4096                 # VM RAM in MB, minimum 2048
    gpu_vram=128                     # VM video RAM in MB, minimum 34, maximum 128
    resolution="1280x800"            # VM display resolution
    
    These values may be customized as described in the documentation.
    
    Press enter to continue, CTRL-C to exit
    
    Catalina selected to be downloaded and installed
    
    stage: prompt_delete_existing_vm
    
    stage: create_vm
    
    stage: check_default_virtual_machine
    
    Checking that VirtualBox starts the virtual machine without errors.
    
    Checking that VirtualBox uses hardware-supported virtualization.
    
    stage: prepare_macos_installation_files
    
    Downloading Apple macOS Catalina software update catalog
    Catalina_sucatalog                       100%[===============================================================================>]   6,52M  1,82MB/s    in 3,6s    
    Trying to find macOS Catalina InstallAssistant download URL
    Catalina_sucatalog_00_InstallAssistantAu 100%[===============================================================================>]  40,05K  --.-KB/s    in 0,03s   
    Found download URL: http://swcdn.apple.com/content/downloads/26/37/001-68446/r1dbqtmf3mtpikjnd04cq31p4jk91dceh8/
    
    Downloading macOS installation files from swcdn.apple.com
    Catalina_BaseSystem.chunklist            100%[===============================================================================>]   1,97K  --.-KB/s    in 0s      
    Catalina_InstallInfo.plist               100%[===============================================================================>]   1,55K  --.-KB/s    in 0s      
    Catalina_AppleDiagnostics.dmg            100%[===============================================================================>]   3,00M  1,64MB/s    in 1,8s    
    Catalina_AppleDiagnostics.chunklist      100%[===============================================================================>]     328  --.-KB/s    in 0s      
    Catalina_BaseSystem.dmg                  100%[===============================================================================>] 475,53M  1,09MB/s    in 5m 47s  
    Catalina_InstallESDDmg.pkg               100%[===============================================================================>]   7,21G  1,84MB/s    in 78m 9s  
    
    Splitting the several-GB InstallESDDmg.pkg into 1GB parts because
    VirtualBox hasn't implemented UDF/HFS VISO support yet and macOS
    doesn't support ISO 9660 Level 3 with files larger than 2GB.
    creating file 'Catalina_InstallESD.part00'
    creating file 'Catalina_InstallESD.part01'
    creating file 'Catalina_InstallESD.part02'
    creating file 'Catalina_InstallESD.part03'
    creating file 'Catalina_InstallESD.part04'
    creating file 'Catalina_InstallESD.part05'
    creating file 'Catalina_InstallESD.part06'
    creating file 'Catalina_InstallESD.part07'
    
    Downloading open-source APFS EFI drivers used for VirtualBox 6.0 and 5.2
    ...even though VirtualBox version 6.1 or higher is detected.
    AppleSupport-v2.0.4-RELEASE.zip          100%[===============================================================================>]  42,20K  --.-KB/s    in 0,1s    
    Archive:  AppleSupport-v2.0.4-RELEASE.zip
      inflating: ApfsDriverLoader.efi    
      inflating: AppleImageLoader.efi    
      inflating: AppleUiSupport.efi      
    
    stage: create_nvram_files
    
    stage: create_macos_installation_files_viso
    Creating EFI startup script
    
    Creating VirtualBox 6 virtual ISO containing the
    installation files from swcdn.apple.com
    
    stage: configure_vm
    
    stage: populate_basesystem_virtual_disk
    Converting BaseSystem.dmg to BaseSystem.img
    
    dmg2img v1.6.7 (c) vu1tur (to@vu1tur.eu.org)
    
    Catalina_BaseSystem.dmg --> Catalina_BaseSystem.img
    
    decompressing:
    opening partition 0 ...             100.00%  ok
    opening partition 1 ...             100.00%  ok
    opening partition 2 ...             100.00%  ok
    opening partition 3 ...             100.00%  ok
    opening partition 4 ...             100.00%  ok
    opening partition 5 ...             100.00%  ok
    opening partition 6 ...             100.00%  ok
    opening partition 7 ...             100.00%  ok
    
    Archive successfully decompressed as Catalina_BaseSystem.img
    Converting from raw image file="Catalina_BaseSystem.img" to file="Catalina_BaseSystem.vdi"...
    Creating dynamic image with size 2138558464 bytes (2040MB)...
    
    stage: create_bootable_installer_virtual_disk
    Creating Catalina installation media virtual disk image.
    0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
    Medium created. UUID: 73d5bc4e-a63c-4ad0-b10e-897beb33428e
    
    stage: populate_bootable_installer_virtual_disk
    
    Creating VirtualBox 6 virtual ISO containing macOS Terminal script
    for partitioning and populating the bootable installer virtual disk.
    
    Starting virtual machine "macOS".
    This should take a couple of minutes. If booting fails, exit the script by
    pressing CTRL-C then see the documentation for information about applying
    different CPU profiles in the section CPU profiles and CPUID settings.
    
    Until the script completes, please do not manually interact with
    the virtual machine.
    
    Please press enter as directed.
    
    Press enter when the Language window is ready.

    Ensuite :

    macos ubuntu virtualbox Created Thu, 28 Jan 2021 00:00:00 +0000
  • J’ai suivi le tutorial : https://www.flawlessrhetoric.com/Using-libpst-to-convert-PST-to-MBOX,-and-understanding-Thunderbird%27s-folder-structure

    J’ai donc fait :

    $ readpst -u backup.pst
    $ mv Outlook\ Data\ File/ out
    $ find out -type d | tac | grep -v '^out$' | xargs -d '\n' -I{} mv {} {}.sbd
    $ find out -name mbox -type f | xargs -d '\n' -I{} echo '"{}" "{}"' | sed -e 's/\.sbd\/mbox"$/"/' | xargs -L 1 mv
    $ find out -empty -type d | xargs -d '\n' rmdir
    rmdir: missing operand
    Try 'rmdir --help' for more information.
    $ find out -type d | egrep '*.sbd' | sed 's/.\{4\}$//' | xargs -d '\n' touch
    $ du -sh *
    4,1G	backup.pst
    3,3G	out

    je ne suis pas sur et certain d’avoir tout mes emails …vu que j’utilise snap le chemin est : /home/login/snap/thunderbird/common/.thunderbird/ID.default/Mail/Local Folders/

    thunderbird Created Mon, 04 Jan 2021 00:00:00 +0000
  • J’ai essayé l’installation de iTunes avec Wine sous Ubuntu.

    Les versions :

    J’ai eu une seule erreur, c’est lors de l’installation des fonts. Pour la fixer j’ai du faire la modification du checkum. L’erreur c’était : sha256sum mismatch! Rename .cache/winetricks/PowerPointViewer/PowerPointViewer.exe and try again.

    sudo sed -i -e s/249473568eba7a1e4f95498acba594e0f42e6581add4dead70c1dfb908a09423/e17cb384eeac4caf08a4f5d4bceb9697fff83fa942d2a3d9ad0294a9b1774390/g /usr/bin/winetricks

    L’installation des fonts :

    sudo apt install winetricks
    winetricks allfonts

    Sachant que l’installation suivante permet d’eviter des problèmes de checksum :

    itunes ubuntu wine Created Tue, 13 Oct 2020 00:00:00 +0000
  • J’ai enfin mon process complet, pour compter les cyclistes et flouter les visages dans la vidéo :

    Etape 1 : Faire la vidéo avec la GoPRO.

    • Le résultat est un MP4.
    • La taille : 91 Mo
    Metadata:
    major_brand : mp42
    minor_version : 0
    compatible_brands: mp42isomavc1
    creation_time : 2020-10-04T13:52:54.000000Z
    encoder : HandBrake 0.9.8 2012071800
    Duration: 00:01:51.44, start: 0.000000, bitrate: 6813 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 6810 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 180k tbc (default)
    Metadata:
    creation_time : 2020-10-04T13:52:54.000000Z
    encoder : JVT/AVC Coding

    Etape 2 : Passer Jupyter Notebook, Python3, Tensorflow, OpenCV.

    Created Mon, 12 Oct 2020 00:00:00 +0000
  • J’ai téléchargé https://github.com/hay/facetool afin de faire la modification des visages via une commande du type :

    ./facetool.py swap -i smiley.jpg -t output-bicyle.mp4 -o swap-bicyle.mp4

    D’abord j’ai eu un premier problème que j’ai fixé ainsi : cd /usr/lib/python3/dist-packages sudo cp apt_pkg.cpython-36m-x86_64-linux-gnu.so apt_pkg.so

    Et maintenant j’ai un bug dans le programme :

    No faces found, could not swap (Faceswapping smiley.jpg on head-tmp-jdrmcn3j/2357.jpg, saving to out-tmp-jdrmcn3j/2357.jpg)
    100%|███████████████████████████████████████████████████████████████████▉| 2671/2672 [25:15<00:00, 2.30it/s]
    No faces found, could not swap (Faceswapping smiley.jpg on head-tmp-jdrmcn3j/1180.jpg, saving to out-tmp-jdrmcn3j/1180.jpg)
    Traceback (most recent call last):
    File "./facetool.py", line 591, in <module>
    main(args)
    File "./facetool.py", line 565, in main
    swapper.swap_image_to_video(args.target, args.input, args.output)
    File "./github/facetool/facetool/swapper.py", line 206, in swap_image_to_video
    combineframes(self.tempdirs.out, out)
    File "./github/facetool/facetool/media.py", line 49, in combineframes
    first_file = list(glob(f"{inp}/*"))[0]
    IndexError: list index out of range

    Bref j’ai l’impression que cela ne détecte aucun visage :

    Created Mon, 12 Oct 2020 00:00:00 +0000
  • J’ai donc pris “Yolo V3”, c’est le modèle le plus fiable. Et j’ai modifier les sources de tracking-yolo-model afin de compter seulement les cyclistes.

    Je mets des ID (que j’ai remplacé par Num) seulement sur les cyclistes :

    Le source est donc :
    
    (H, W) = (None, None) # input image height and width for the network
    writer = None
    bicycle = 0
    while(True):
    
    ok, image = cap.read()
    
    if not ok:
    print("Cannot read the video feed.")
    break
    
    if W is None or H is None: (H, W) = image.shape[:2]
    
    blob = cv.dnn.blobFromImage(image, 1 / 255.0, (416, 416), swapRB=True, crop=False)
    net.setInput(blob)
    detections_layer = net.forward(layer_names) # detect objects using object detection model
    
    detections_bbox = [] # bounding box for detections
    
    boxes, confidences, classIDs = [], [], []
    for out in detections_layer:
    for detection in out:
    scores = detection[5:]
    classID = np.argmax(scores)
    confidence = scores[classID]
    
    if confidence > yolomodel['confidence_threshold']:
    box = detection[0:4] * np.array([W, H, W, H])
    (centerX, centerY, width, height) = box.astype("int")
    x = int(centerX - (width / 2))
    y = int(centerY - (height / 2))
    
    boxes.append([x, y, int(width), int(height)])
    confidences.append(float(confidence))
    classIDs.append(classID)
    
    idxs = cv.dnn.NMSBoxes(boxes, confidences, yolomodel["confidence_threshold"], yolomodel["threshold"])
    
    if len(idxs)>0:
    for i in idxs.flatten():
    (x, y) = (boxes[i][0], boxes[i][1])
    (w, h) = (boxes[i][2], boxes[i][3])
    if (labels[classIDs[i]] == 'bicycle'):
    detections_bbox.append((x, y, x+w, y+h))
    clr = [int(c) for c in bbox_colors[classIDs[i]]]
    cv.rectangle(image, (x, y), (x+w, y+h), clr, 2)
    cv.putText(image, "{}: {:.4f}".format(labels[classIDs[i]], confidences[i]),
    (x, y-5), cv.FONT_HERSHEY_SIMPLEX, 0.5, clr, 2)
    
    objects = tracker.update(detections_bbox) # update tracker based on the newly detected objects
    
    for (objectID, centroid) in objects.items():
    text = "Num {}".format(objectID)
    if (int(format(objectID)) > bicycle):
    bicycle = int(format(objectID))
    text2 = "Total %d "%(bicycle+1)
    cv.putText(image, text, (centroid[0] - 10, centroid[1] - 10), cv.FONT_HERSHEY_SIMPLEX,
    0.5, (0, 255, 0), 2)
    cv.circle(image, (centroid[0], centroid[1]), 4, (0, 255, 0), -1)
    cv.putText(image, text2, (30, 30), cv.FONT_HERSHEY_SIMPLEX,
    1, (0, 0, 255), 3)
    
    cv.imshow("image", image)
    
    if cv.waitKey(1) & 0xFF == ord('q'):
    break
    
    if writer is None:
    fourcc = cv.VideoWriter_fourcc(*"MJPG")
    writer = cv.VideoWriter("output-bicyle.avi", fourcc, 30, (W, H), True)
    writer.write(image)
    writer.release()
    cap.release()
    cv.destroyWindow("image")

    Cette fois je compte en double des cyclistes, je pense qu’avec plus d’images par seconde je n’aurai pas eu le problème. J’ai un total de 280 cyclistes.

    Created Sun, 11 Oct 2020 00:00:00 +0000