Google Colab is telling me that a path to a video input is not set when it clearly is set correctly - computer-vision

I am using google colab GPU to run an open source vehicle counting system on the darknet/yolov3 framework. I was able to get yolov3 running perfectly for video object detection. I cannot get this second repository to run and I think it is a google colab issue because I am new to it. Ivy-master and darknet-master are cloned under content, I also tried saving these in drive but it did not make a difference.
I have my .env file set up as vars.env and installed the colab-env. When I run !python -m main in colab, I get the error Path to video or camera input not set. My variable in my vars.env file looks like so:
VIDEO="./content/vehiclesystem/data/demodata/videos/sample.mp4". The path is correct, so why is colab telling me the path is not set? I have tried asking owner for help but no luck.

I think the path should not contain the . (dot). But for certain results, try to go to the files panel on the left side and find the path by right-clicking the mp4 file and selecting Copy Path option.
Paste this path into your variable in my vars.env file. It should work now :)

Related

Not able to save file deployed on jetty server

I have deployed my webapplication on a jetty server, and I am trying to edit those deployed files using WebStorm 8.0.4. But I am unable to save the edited files and getting the following error:
Try turning the 'safe write' feature (Settings/General, 'Use safe writes') off - does it help? It creates a temporary copy of a file: creates a separate temp file, deletes the original and then renames. With this option the original file permissions may be lost, this causes problems, especially when working on remote drives.
Follow these steps.
Open C:\Users\YourUserName\.m2\repository (If you use maven)
Find org folder and Navigate org\eclipse\jetty\jetty-webapp\yourJettyVersion
There will be a .jar file.
Open it with winrar or some program like winrar.
Navigate org\eclipse\jetty\webapp
Find webdefault.xml and Open it with any text editor.
Search useFileMappedBuffer parameter in file
You will see a param value.
Change it to false.
Save and Exit.
I'm sorry for any English mistakes.

Use system() to call executable in a changing directory

I am writing a simple C++ helpertool for a popular game (League of Legends), targeted at windows users.
I wish to allow the user to auto restart games which crash. This can be done by starting 'leagueoflegends.exe'. I want to autodetect the location of the executable and this is where I have issues.
The exe is located at:
*GAME_FOLDER*\RADS\solutions\lol_game_client_sln\releases\x.x.x.xx\leagueoflegends.exe
I use a registry entry to get the game folder, ie: C:\leagueoflegends\
However there is a folder that changed with every update in the form of x.x.x.xx where the x are digits (numbers) reflecting the versions. There is always 1 folder in the releases folder.
I figured I need to use REGEXP but I didn't have much luck.
This is the regexp I made:
^[0-9]\.[0-9]\.[0-9]\.[0-9][0-9]$
This is what I used to get the name of the dir using cmd
dir /B | findstr /R " ^[0-9]\.[0-9]\.[0-9]\.[0-9][0-9]$"
However I cant seem to be able to run the executable no matter what I do. Its not like linux where I can manipulate filters and pipes. Any help with a one liner to run the exe or methods of obtaining the folder name (without using a system call?) would be appreciated. Once I can get the folder name in a variable then it becomes easy.
Thanks in advance!

How can i Extract Files From VDI

I was using VirtualBox on my PC(WIN 7)
I managed to View some files in my .VDI file..
How can I open or view the contents of my .vdi file and retrieve the files from there?
I had a corrupted VDI file (according to countless VDI-viewer programs I've used with cryptic errors like invalid handle, no file selected, please format disk) and I was not able to open the file, even with VirtualBox. I tried to convert it using the VirtualBox command line tools, with no success. I tried mounting it to a new virtual machine, tried mounting it with ImDisk, no dice. I read four Microsoft TechNet articles, downloaded their utilities and tried countless things; no success.
However, when I tried 7Zip (https://www.7-zip.org/download.html) I was able to view all of the files, and extract them selectively. Here's how I did it:
install 7zip (make sure that you also install the context-menu items, if prompted.)
right-click on the VDI file, select "Open Archive"
when the window appears, right click on the largest file in the archive (there should be two files, one is "Basic Microsoft Data Partition" and the other one something else, called system or something.) Left click on the largest one and click "Open inside". The file size is listed to the right of each file in bytes.
you should see all of the files inside of the archive. You can drag files that you'd like to extract right to your desktop. You can double click on folders to view inside them too.
If 7zip gives you a cryptic error after extracting the files, it means that you closed the folder's window that you are copying files to in Windows Explorer.
If you didn't close the window and you're still getting an error, try extracting each sub-folder individually. Also make sure that you have enough local hard drive space to copy the files to, even if you are copying them just to an external disk, as 7zip copies them first to your local disk. If the files are highly compressible, you might be able to get away with using NTFS compression for the AppData/temp folder so that when 7zip extracts the files locally, it'll compress them so that it can copy them over to your other disk.
You can mount partitions from .vdi images using qemu-nbd:
sudo apt install qemu-utils
sudo modprobe nbd
vdi="/path/to/your.vdi" # <<== Edit this
sudo qemu-nbd -c /dev/nbd0 "$vdi"
# view partitions and select the one you want to mount.
# Using parted here, but you can also use cfdisk, fdisk, etc.
sudo parted /dev/nbd0 print
part=nbd0p2 # <<== partition you want to mount
sudo mkdir /mnt/vdi
sudo mount /dev/$part /mnt/vdi
Some users seem to need to add a parameter to the modprobe command. I didn't with Ubuntu 16.04, but if it doesn't work for you, try adding max_part=16 :
sudo modprobe nbd max_part=16
When done:
sudo umount /dev/$part
sudo qemu-nbd --disconnect /dev/nbd0
Try out VMXray.
You can explore your vmdk image right inside your browser. Select the files that you want to extract and extract them to the desired location. Not just vmdk, you can use VMXRay for looking into and extracting files from RAW, QEMU/KVM QCOW2, Virtualbox VDI, and ISO images. ext2, ext3, FAT and NTFS are current supported file systems. You can also use this to recover deleted photos from raw dumps of your camera's SD card, for example.
And, do not worry, no data from your files is ever sent over the network. Data never leaves your machine. VMXRay works completely inside your browser.
As a first approach you can simply try any archive viewer to open .vdi file.
I tried 7zip to open Ubuntu Mate .vdi file and it shown all Linux file system like below.
An easy way is to attach the VDI as a second disk in another Virtual Machine.
The drive does not appear immediately; in Windows go to Disk Manager, bring the disk online and assign it a drive letter.
You can use ImDisk to mount VDI file as a local drive in Windows. Follow this virtualbox forum thread and become happy )) Also you can convert VDI to VHD and use default Windows Disk manager to mount VHD (described here)

Why does my web-app work offline in Firefox, but not on iPad?

I recently wrote a few scripts for Javascript which I am trying to run as a native app on my iPad in offline mode.
The scripts do nothing complex, simply run off a bunch of prompts and generate a document.write() based on the information the user has entered.
So I set up my own little website to host the scripts on and went about setting up an application cache. I am new to this sort of thing however from what I gather, I have followed instructions correctly. To set up my app cache, I did the following:
Added the following two lines to my .htaccess file:
AddType text/cache-manifest .manifest
AddType text/manifest .manifest
Made a new file called "generator.manifest", which has the following lines:
CACHE MANIFEST
generator.html
answergenerator.js
And added in to my generator.html file:
Apart from a few functions used to prompt some iOS features, all I have in my generator.html file is this:
along with the other stock standard html tags.
That is my appcache setup. The generator.manifest file is in the exact same directory as the generator.html file.
When I enter Firefox and go to my site, I can run the script, allow it to cache files for offline usage (Firefox comes up with a prompt), and then run the script in offline mode.
HOWEVER, whenever I try to do this on my iPad (4.2.1), I simply get the error: "Generator could not be opened because it is not connected to the Internet."
Where have I gone wrong? Can someone help me fix this please?
A huge thanks in advance,
Haz.
You might look at this answer. iOS does seem to have some issues. I found that I had to power cycle my iPad (in addition to clearing open Safari's) before it would recognize the appcache.

Where to start for writing a shell script for copying elements into main app xcode4

I am looking for some documentation or tutorial for copying files from a given directory into the app created by xcode at build time, before it is run.
At first I have tried to copy files into the derived directory, hoping that everything resides in there would be automatically added to the app, but I was wrong.
So I am looking for a script because the original dir may change its name, second the script could be customized by another xcode 4 user with its src dir path etc.
The things is I don't know how to start, which language etc. I am quite confident with shell script, but maybe there's a better option.
Second, I am trying to figure out which command could add a file in the already built app.
thanks
That answer didn't really help - the BUILT_PRODUCT_DIR isn't where most stuff goes.
Ultimately, I found you just need to do:
Add the following to the very end of your script (or get your script to write directly to the output location):
cp ${DERIVED_FILE_DIR}/[YOUR OUTPUT FILES] ${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}
...but there's a lot of other things I tried. More thoughts and ideas here: http://red-glasses.com/index.php/tutorials/xcode4-a-script-that-creates-adds-files-to-your-project/
You want a Run Script or Copy Files build phase. Select your main project in the navigator, then select the app's target. Click the Build Phases tab. Click the Add Build Phase button at the bottom of the window and choose the appropriate phase.
By "appropriate" I mean if you really want to run a script, you'll use a Run Script build phase and use Xcode-provided environment variables like $BUILT_PRODUCT_DIR (see the documentation or hit build and examine the full output of an empty script in the build log) to figure out your target folder. If all you want to do is copy files (no real processing), the Copy Files build phase already knows how to locate the app bundle's proper folders depending on what you're copying (Resources, Frameworks, etc.).